Script format, Script format 226 – Nortel Networks WEB OS 212777 User Manual

Page 226

Advertising
background image

Web OS 10.0 Application Guide

226

n

Chapter 10: Health Checking

212777-A, February 2002

Script Format

The general format for health-check scripts is shown below:

N

OTE

If you are doing HTTP 1.1 pipelining, you need to individually open and close each

response in the script.

n

Each script should start with the command

open

port

<protocol port number>. The

next line can be either a

send

or

expect

.

n

The first word is the method. This is usually

get

; however, HTTP supports several other

commands, including

put

and

head

. The second word indicates the content desired, or

request-URI, and the third word represents the version of the protocol used by the client.

If you supplied HTTP/1.1 for the protocol version, you would also have to add in the fol-
lowing line:

Host: www.hostname.com

Example:

GET /index.html HTTP/1.1

(press Enter key)

Host: www.hostname.com

(press Enter key twice)

This is known as a host header. It is important to include because most Web sites now
require it for proper processing. Host headers were optional in HTTP/1.0 but are required
when you use HTTP/1.1+.

n

In order to tell the Web server you have finished entering header information, a blank line
of input is needed after all headers. At this point, the URL will be processed and the
results returned to you.

N

OTE

If you make an error, enter

rem

to remove the last typed script line entered. If you

need to remove more than one line, enter

rem

for each line that needs to be removed.

n

The switch provides the “\” prompt, which is one enter key stroke. When using the

send

command, note what happens when you type the

send

command with the command

string. When you type

send

, press enter and allow the switch to format the command

string (that is, \ versus \\).

open

application_port

(e.g., 80 for HTTP, 23 for Telnet, etc.)

send

request1

expect

response1

send

request2

expect

response2

send

request3

expect

response3

close

Advertising