Forum Discussion
BIG-IP : determine active device
Hi Hamish,
Your script uses System.Failover.get_failover_state() - https://devcentral.f5.com/wiki/iControl.System__Failover__get_failover_state.ashx. Calling that against my test HA pair (both units are active for different traffic-groups) shows:
>>> print b1.System.Failover.get_failover_state()
FAILOVER_STATE_ACTIVE
>>> print b2.System.Failover.get_failover_state()
FAILOVER_STATE_ACTIVE
When calling Management.DeviceGroup.get_failover_status(), output shows the failover status per device with more detail, such as all active traffic-groups on that device. For example, the same call with 10 traffic groups. 1-5 are active on lb-01 and 6-10 are active on lb-02:
>>> print b1.Management.DeviceGroup.get_failover_status()
{'failover_status': 'HA_STATE_ACTIVE', 'color': 'COLOR_GREEN', 'status': 'ACTIVE', 'details': ['active for /Common/traffic-group-10', 'active for /Common/traffic-group-7', 'active for /Common/traffic-group-6', 'active for /Common/traffic-group-9', 'active for /Common/traffic-group-8'], 'summary': '5/10 active'}
>>> print b2.Management.DeviceGroup.get_failover_status()
{'failover_status': 'HA_STATE_ACTIVE', 'color': 'COLOR_GREEN', 'status': 'ACTIVE', 'details': ['active for /Common/traffic-group-1', 'active for /Common/traffic-group-3', 'active for /Common/traffic-group-4', 'active for /Common/traffic-group-2', 'active for /Common/traffic-group-5'], 'summary': '5/10 active'}
I do not see anything that shows where a specified traffic-group is active - I was looking under Management.TrafficGroup (https://devcentral.f5.com/wiki/iControl.Management__TrafficGroup.ashx) but only saw calls for configuration details
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com