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

James_Smith_299's avatar
James_Smith_299
Icon for Nimbostratus rankNimbostratus
Dec 07, 2016

Script that queries pair of BIG-IP LTM to detect which one is Active

Is there a tool or script that queries pair of BIG-IP LTM to detect which one is Active without needing to login Web UI or ssh?

 

Possibly something we can run from Windows 2003 / 2008 server where we connect from to the F5 units.

 

3 Replies

  • using iControl REST, you could for example query the following path with curl:

    curl -sk -u admin:mypass https://my-bigip/mgmt/tm/cm/device | python -mjson.tool

    This will return a json formatted list of all devices in your device group. One of the fields for each device is "failoverState", that will either return active or standby.

  • Hi James,

    another option would be to create a HTTP-based Virtual Server for each of your traffic-groups and then assign the iRule below...

    when HTTP_REQUEST {
        HTTP::respond 200 content [info hostname] Content-Type text/html
    }
    

    A simple unauthenticated HTTP request towards the Virtual Server will tell you then on which cluster unit the traffic group is running on.

    Cheers, Kai