Forum Discussion

gargolek_116822's avatar
gargolek_116822
Icon for Nimbostratus rankNimbostratus
Apr 16, 2013

Health check in body

Hello,

 

 

I am pretty new to F5 over all...:)

 

I need to create helth monitor which will check for body of the page and return 200 OK.

 

I tried below:

 

"

 

Send: GET /invoke/abc.Monitors.URL:urlMonitor HTTP/1.0\r\nHost:localhost\r\n\r\n

 

 

Received: 200 OK

 

"

 

But this is not checking in the body just i guess avilbility of the whole page (hopefully i am not mistaken) :)

 

 

I asked someone for help and they using curl get below output but still i have trouble...any help woul be approciated.

 

"

 

326001647:~$ curl -v

 

http://abc.abc.net:5555/invoke/abc.Monitors.URL:urlMonitor

 

* About to connect() to abc.abc.net port 5555 (0)

 

* Trying 1.1.1.1... connected

 

* Connected to abc.abc.ne (1.1.1.1) port 5555 (0)

 

> GET /invoke/abc.Monitors.URL:urlMonitor HTTP/1.1

 

> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4

 

>OpenSSL/0.9.8r zlib/1.2.5

 

> Host: abc.abc.net:5555

 

> Accept: */*

 

>

 

< HTTP/1.1 200 OK

 

< Content-Type: text/html; charset=UTF-8

 

< Content-Length: 7

 

<

 

* Connection 0 to host abc.abc.net:5555 left intact

 

* Closing connection 0

 

 

"

 

 

 

Thanks in advance L.

 

 

3 Replies

  • I've seen a similar question here and maybe the same change will help you, 1st try changing your receive string> try just the number 200, thats what we use.

     

    Our working monitor looks like this since our servers expect to see a host header,

     

    HEAD /server/Healthstatus.asp HTTP/1.1\nHost: healthcheck.org \nConnection: close\r\n\r\n

     

    another example we use without a host header is

     

    HEAD /server/heartbeat.html HTTP/1.0\r\n\r\n

     

    hope this helps
  • Thank you, this will be sending string but what would be receiving string, if health need to be based on body of html page?

     

     

    Thank you in advance,
  • The receive string needs to be something contained within the body that would only be present if the server/application was working. Your best bet is to get copy of the page source and discuss with the web/app team what the best string within it would be best to check for.