Forum Discussion
Robert_47833
Altostratus
Jul 05, 2017how to get active ltm via python f5-sdk
self.mgmt = ManagementRoot(host, user, passwd)
self.mgmt.tm.sys.failover.load()
but I can't get active lba.
any one who has exeprience on this and share me the code?
Satoshi_Toyosa1
Feb 07, 2018Ret. Employee
The python equivalent of the above as below. In addition, it checks the status of two hosts in HA (assuming both hosts have the same userid/passwd).
from f5.bigip import ManagementRoot
for ip in ['192.168.226.41', '192.168.226.131']:
mgmt = ManagementRoot(ip, 'admin', 'admin')
fail = mgmt.tm.sys.failover.load()
failOverStat = fail.apiRawValues['apiAnonymous'].rstrip()
print "%s: Ver %s, %s" % (ip, mgmt.tmos_version, failOverStat)
Sample output:
192.168.226.41: Ver 13.0.0, Failover standby for 0d 04:35:49
192.168.226.131: Ver 13.0.0, Failover active for 0d 04:35:52
See also F5 Python SDK API Docs.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
