Forum Discussion
Andyds39_367328
Nimbostratus
Jul 18, 2018Perl/Python script to fetch the LB, VIP and pool details of a server
I have a database where all my LTMs information are stored. I am trying to get a perl/ python script.
The use case is: running the script with a specific server IP, I am expecting an output whic...
Andy_McGrath
Cumulonimbus
Jul 19, 2018Look at the F5-SDK for python. It is a simple module that uses iControl REST to get and set F5 configuration.
Good article to get you started is F5 Friday Python SDK for BIG-IP.
Not tested but something like the following as a very basic script (you would need to update the 'listOfBipIPs' to pull from your data base:
from f5.bigip import BigIP
listOfBigIPs = ["bigip1.example.com", "bigip2.example.com"]
for bigIP in listOfBigIPs:
bigip = BigIP("bigip.example.com", "admin", "somepassword")
virtuals = bigip.tm.ltm.virtual.get_collection()
for virtual in virtuals:
print ("VS: {}, Dest: {}".format(virtual.name, virtual.destination))
print (" Pool: {}".format(virtual.pool))
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