Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

syntax for simple http monitor

Michaelyang
Cirrostratus
Cirrostratus

Hello,

I am trying to create an http monitor
and Send String is
HEAD / HTTP/1.1

I want this string will accept HTTP status codes of 200 and 401. Any error codes (ie: 4xx and 5xx) will cause the receive string not to be matched and the check to fail.
So Receive String is
HTTP/1\.[01] [200][401]

But when I tried to do some experimenting I found it odd
EX.

1.png2.png

I would like to ask why my curl web clearly shows 200 OK,
but my monitor does not work when I fill in 200, but it does when I fill in 401

Any help is appreciated.

1 ACCEPTED SOLUTION

xuwen
MVP
MVP

use this linux bash to watch the pool member http response:

echo -e "HEAD / HTTP/1.1" | nc 192.168.10.11 80

and you Send String use HTTP/1.1, some web server maybe require you bring http Host Header,chang to this:

firstly use echo -e "HEAD / HTTP/1.0\r\nConnection: close\r\n\r\n" | nc 192.168.10.11 80

to watch the pool member response

Send String is HEAD / HTTP/1.0\r\nConnection: close\r\n\r\n

Receive String is HTTP/1\.(0|1) (200|401)

 

View solution in original post

3 REPLIES 3

xuwen
MVP
MVP

use this linux bash to watch the pool member http response:

echo -e "HEAD / HTTP/1.1" | nc 192.168.10.11 80

and you Send String use HTTP/1.1, some web server maybe require you bring http Host Header,chang to this:

firstly use echo -e "HEAD / HTTP/1.0\r\nConnection: close\r\n\r\n" | nc 192.168.10.11 80

to watch the pool member response

Send String is HEAD / HTTP/1.0\r\nConnection: close\r\n\r\n

Receive String is HTTP/1\.(0|1) (200|401)

 

Hello Xuwen,

Thanks for your reply
I have some questions to ask you
Why Send String is "HEAD / HTTP/1.0\r\nConnection: close\r\n\r\n"
not "HEAD / HTTP/1.1\r\nConnection: close\r\n\r\n"

According to the protocol, HTTP/1.1 requires that the request header should bring a Host Header(some web servers can be compatible with HTTP/1.1 requests without a Host, and some will return a 40X status code), while HTTP/1.0 does not require mandatory carrying of a Host. The web server code should be compatible with HTTP/1.0 requests. The Send String in the built-in http monitor cannot carry a $1 variable instead of node ip when your pool have more than two pool members, You can also use external monitor and curl in the Linux shell to detect

Bigip has a Linux shell template located in System ›› File Management: External Monitor Program File List ›› sample_ Monitor, you can use it after a little modification