Forum Discussion

cbrdy's avatar
cbrdy
Icon for Nimbostratus rankNimbostratus
May 08, 2021

Check response headers in pool member monitor

Hello,

 

Is it possible with pool member monitor to verify if a response header is set to true and disable the node based on that?

 

Thanks,

Charan

  • Yes. You can create a reverse monitor and set the receive string in the monitor to the header and its value. For example, the reverse monitor below sends an HTTP 1.1 HEAD request for index.php to the pool member and checks the response for an HTTP header called X-Server-Disabled with the value true. If found, the monitor marks the pool member down, the reverse of what it would normally do if the reverse option was not enabled in the monitor. Note that the monitor must send either an HTTP 1.0 or HTTP 1.1 request for headers to be examined on the response.

    ltm monitor http http_custom_monitor {
        adaptive disabled
        defaults-from http
        destination *:http
        interval 5
        ip-dscp 0
        recv "X-Server-Disabled\: true"
        recv-disable none
        reverse enabled
        send "HEAD /index.php HTTP1.1\r\nHost:www.f5trn.com\r\n\r\n"
        time-until-up 0
        timeout 16
    }