Forum Discussion

F5_bulldog_5968's avatar
F5_bulldog_5968
Icon for Nimbostratus rankNimbostratus
Feb 06, 2012

Health monitor questions

I am not the most experienced at writing custom health monitors, and I need help creating one using send and receive strings. We have three servers in a pool, and today, we are using a basic tcp monitor on port 8182 to monitor the pool members. The problem is that even though the monitor sees the pool members available, the service may not be completely up and ready to handle requests.

 

 

Below is a successful request and response we need to use to make sure the service is completely up and ready. My question is: how do I write a health monitor that send a requests then looks for

 

 

Request

 

 

 

3 Replies

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    What's the protocol?

     

     

    There's lots of options. Protocols like HTTP or SIP or SOAP have boiler plate monitors in place where you can essentically insert your request and a string to look for in the response.

     

     

    Proprietary protocols (or protocols not supported directly by BigIP sich as FIX, MQ etc) usually require an external monitor (Although simple ones could be done with a tcp or udp monitor). Basically anything you can write in bash, perl, tmsh etc that the BigIP can run will be called with the monitoring parameters supplied to it. The script can then make the connection, perform the request and check the results, do whaveer additional checks required (Sideband, time of day anything your imagination can come up with), and return the poolmember status.

     

     

    Custom monitors just need to be executable and placed in the /usr/bin/monitors directory. There's a sample monitor (/usr/bin/monitors/sample_monitor) in there already for you to look at (Shows how to get the IPv4 address from the supplied IPv6 address, etc).

     

     

    H
  • The protocol is HTTP. Would a simple GET do the trick, and then look for a particular line of text in the response. The app guys have recommended looking for "overallStatusCode="0000"" in the response.
  • e.g.

    [root@ve1023:Active] config  b pool foo list
    pool foo {
       monitor all myhttp
       members 200.200.200.101:8182 {}
    }
    [root@ve1023:Active] config  b monitor myhttp list
    monitor myhttp {
       defaults from http
       recv "overallStatusCode=\"0000\""
       send "GET /test.html HTTP/1.1\r\nHost: \r\nConnection: Close\r\n\r\n"
    }
    
    [root@ve1023:Active] config  curl http://200.200.200.101:8182/test.html
    ...
    overallStatusCode="0000"
    ...
    
    [root@ve1023:Active] config  b pool foo|grep -i pool\ member
    +-> POOL MEMBER foo/200.200.200.101:8182   active,up
    
    [root@ve1023:Active] config  curl http://200.200.200.101:8182/test.html
    ...
    overallStatusCode="0001"
    ...
    
    [root@ve1023:Active] config  b pool foo|grep -i pool\ member
    +-> POOL MEMBER foo/200.200.200.101:8182   inactive,down