Forum Discussion

Formater's avatar
Icon for Employee rankEmployee
Jan 27, 2011

How send a string to a specific IP's specific port when all pool members of a VIP are down?

I have a customer who has a pool, which includes there pool members. They want to send some special string in TCP to a specific IP's specific port when all the members of this pool are down. For example, when all members of the pool are down, just send message "down" to The VIP they uses is a Standard type, and the version is v9.3.1



I am wondering to use TCP::response to reponse, but the specific port is NOT port carrried in TCP::response.



Anyone has some idea?





3 Replies

  • Hi Johnson,



    I wonder if you could check for [active_members [LB::server pool]] == 0 in CLIENT_ACCEPTED. If it is true, then collect the TCP payload with TCP::collect, replace all of it with TCP::payload replace and then select a new destination IP:port with the node command. Here are the wiki pages for the related commands:









  • Colin_Walker_12's avatar
    Historic F5 Account
    Aaron: That sounds plausible, actually. You couldn't use LB::server pool in CLIENT_ACCEPTED really, since no pool would have been selected yet, but you could certainly use active_members if you know the specific pool anyway.

    Something like (very untested):

      if {[active_members yourpoolname] == 0 } {
    when CLIENT_DATA {
      TCP::payload replace 0 [TCP::payload length] "down"
      node 12000

    Worth a shot at least. Try it out on a test VIP first as it's not tested, but that's the general idea.

  • [LB::server] and [LB::server pool] will return the virtual server's default pool name until a load balancing decision has been made. Once a load balancing decision has been made, [LB::server] will return a Tcl list with pool, node addr and port.



    I think it was Unruley who pointed this out originally a while back. It makes for a simple way to avoid having to hard code the default pool name in iRules.