Forum Discussion
Wally_Steadman_
Nimbostratus
Nov 13, 2012Using PyControl for LTMs v9.4.8 through 11.2
So I am new to Python and IControl. I have built a python script that will take a list of hostnames and make sure they are reachable. This is a text file with the following format:
hostname1.m...
Indrek_38497
Nimbostratus
Nov 29, 2012Hello,
For getting version of BIG-IP software can be used next code:
!/usr/bin/python
def get_version(obj):
try:
return obj.LocalLB.VirtualServer.get_version()
except Exception, e:
print e
if __name__ == "__main__":
import bigsuds
import getpass
f = open('./devices_list.txt', 'rU')
o = open('./versions_list.txt', 'w')
for list in f:
b = bigsuds.BIGIP(
hostname = list.rstrip(),
username = "username",
password = "password",)
fstr = "Device %s is running version %s\n" % (list.rstrip(), get_version(b))
o.write(fstr)
print fstr.rstrip()
f.close()
o.close()
Regards,
Indrek
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