N-central Help

KBA10005: Using Telnet Emulation to Check HTTP Status Codes

Knowledge Base Article #:

10005

Applicable Versions:

N-central 6.5, 6.7, 7.x, 8.x, 9.x

Date Created/Updated:

April 27, 2011

Introduction

In order to confirm access to a web resource, whether it is the Central Server or a Web Page, it sometimes can be necessary to emulate the connection that a web browser performs.

The Telnet command allows us a means of performing this emulation manually. Telnet is a user command that uses the Internet standard protocol for remote terminal connections.

Process

Examples will be provided for Windows and Linux. The general format for using Telnet from the command line is as follows

Format:

telnet <IP address or FQDN> <Port>

For this example, we wish to confirm HTTP (Port 80) responsiveness of 'www.n-able.com':

telnet www.n-able.com.com 80

Windows

Z:> telnet www.n-able.com.com 80
Connecting To www.n-able.com...

<Screen will clear, and typed characters will not appear on screen.>

Linux/Unix

[root@hwp root]# telnet www.n-able.com 80
Trying 69.42.109.120...
Connected to www.n-able.com
Escape character is '^]'.

Once you have established whether or not you have port connectivity, you can then further test the availability of such services such as HTTP or HTTPS, even SMTP commands can be issued via a Telnet session to send an email.

Testing HTTP Availability and Response

Once you have established the session, the following commands can be issued to invoke an HTTP request. Note that when doing this on a Windows machine, the text you type will not appear as you type it and the backspace key will not function. Be sure to type carefully.

HEAD / HTTP/1.0<ENTER><ENTER>

<ENTER><ENTER> denotes htting the 'Enter' key on your keyboard twice.

The resulting response will depend, but a Normal HTTP response code is 200 OK

Windows

HTTP/1.1 200 OK
Date: Sat, 16 Jul 2005 14:27:00 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
ETag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Content-Length: 438
Connection: close
Content-Type: text/html

Linux

HTTP/1.1 200 OK
Date: Sat, 16 Jul 2005 14:27:00 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
ETag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Content-Length: 438
Connection: close
Content-Type: text/html