For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Sumanta_88744's avatar
Apr 15, 2016

How to track a pool member status availability via i call script?

Hi Experts

How do I track a pool member status from i-call script? Pool-1 has nodes, node-1 and node-2. I need to track node-1 status and take action so that I can shut down another node in a different pool. I can not track only node since it can not be health checked by TCP/HTTP. Only ICMP health checks are not enough to give real status of App nodes. So I have to track individual pool member.

Will the below work or need to be edited more?

sys icall script /Common/down_event {

app-service none

definition {

     This script is triggered via alertd and will only trigger when a pool member is DOWN

     Node 1 status

    set dev_objs [tmsh::get_status /ltm pool /Common/pool-1 member /Common/node-1:80]

    foreach dev_obj $dev_objs {

        set STATUS_1 [tmsh::get_field_value $dev_obj "status.availability-state"]

    }

    ----------------------------------------------------

     "If node-1 is down, disable another node NODE-1 as well"

    ----------------------------------------------------

       tmsh::log " $STATUS_1"

    if {($STATUS_1 == "Offline")}{

        node reported as down

       tmsh::log "Node-1 for pool-1 is down. DISABLING NODE-1 in pool-2"

       tmsh::modify /ltm node NODE-1 state user-down

    }

    }

1 Reply

  • Hi,

     

    Very interesting what you want to do.

     

    Even so, why don't you do it by setting the specific monitor to that node?

     

    So, if you create a TCP/HTTP monitor with a specific port, it should be able to use on node level.

     

    Respectfully.