Forum Discussion

Chimy's avatar
Chimy
Icon for Nimbostratus rankNimbostratus
Feb 27, 2023

http monitor send string: IP node / name node / pool name

I desire create a monitor that include a variable about the ip node, name node or pool name.

The idea is create a only only one monitor and use to several pools, or nodes.

 

For example

a pool named www.company.com has three nodes

--- node1: 192.168.1.10

--- node2: 192.168.1.20

--- node3: 192.168.1.30

 

pool monitor

Send string:  'GET / HTTP/1.1\r\nHost: <pool_name>\r\nConnection: Close\r\n\r\n'

or

Send string:  'GET / HTTP/1.1\r\nHost: <ip_node1>\r\nConnection: Close\r\n\r\n'

or

Send string:  'GET / HTTP/1.1\r\nHost: <name_node1>\r\nConnection: Close\r\n\r\n'

 

node monitor

Send string:  'GET / HTTP/1.1\r\nHost: <ip_node1>\r\nConnection: Close\r\n\r\n'

or

Send string:  'GET / HTTP/1.1\r\nHost: <name_node1>\r\nConnection: Close\r\n\r\n'

 

As I said which is the variable to replace <pool_name> in the send string. ?

which is the variable to replace <ip_node1> in the send string. ?

which is the variable to replace <name_node1> in the send string. ?

 

 

 

4 Replies

  • Chimy sadly I don't believe a way exists to dynamically populate the host header value so that you can use one health monitor. You would have to configure 3 seperate health monitors and associate them to the appropriate pool member.

  • Hi, Chimy 

    First, and as Paulius said, there is no variable substitution configuration for monitors. But... allow me to give you some ideas.

    1. I wouldn't bother with a node monitor at all, but that's personal opinion. I mean... if the service at pool-member level is working, why would I care about the node? This might be a wrong idea for some scenarios, but to be honest I haven't found a situation in which node-level monitoring had any applicability. More traffic for nothing, in my opinion.

    2. If you really want a node monitor, I wouldn't use the same type that you're already using in your pool members. Maybe an ICMP type monitor would work best at node level.

    3. Unless you're making some host HTTP header replacement with iRules, your servers should probably be configured to accept traffic directed to the proper value, which in this case would be "www.company.com". So why not use just that in the pool monitor?

    4. If you're just waiting for a "200 OK" response, you're better off using HEAD instead of GET.

    5. Instead of "/" as resource, use something that allows the server administrator to put the server down for maintenance on his own. Something like "HEAD /healthcheck.html HTTP/1.1\r\nHost: www.company.com\r\nConnection: Close\r\n\r\n", for example. The admin would only have to rename the file to put the server in maintenance mode, without having to disable the HTTP daemon.

    /Mike

    • Chimy's avatar
      Chimy
      Icon for Nimbostratus rankNimbostratus

      Well.,

      The idea is set a pool name as

      www.service1.com

      www.service2.com

      .

      .

      www.service3.com

      so, with only one http monitor config can monitor all pools, having a $varciable that could take the value from the pool name.
      Also, I asked about if there some way to take the values (node name or IP ) from the nodes

       

      Note: HEAD instead of GET <<- good point. I will use that option

      • Chimy It is not possilbe to perform this dynamic host field in a single health monitor for anything that is built in. It might be possible to create an external health monitor to do this but I'm not familiar enough with external monitors in order to do this. In addition, having an external monitor ends up using significantly more resources and over complicates the configuration of your F5. You should create either multiple pools with a unique health monitor per pool or one pool and assign multiple health monitors for each host and then utilize an iRule to perform validation on what health monitors are passing and failing and send the appropriate failed response to the client for specific health monitor failures. This second option is a bit more complicated and you're better off creating a unique pool and health monitor per host.