Forum Discussion
K-Dubb
Nimbostratus
Jun 13, 2011Pool_Member_Status_Page_on_a_Virtual_Server (Topic Changed)
Hi,
I am trying to use this from windows command line: http://devcentral.f5.com/wiki/default.aspx/iControl/pyControlQuickPoolStatus.html. I have python installed on the server. I saved the syntax/usage section to a file called check.py and modified host, user and password. I saved the main script to a file called pool_status.py. I am calling check.py from comand line and I get:
C:\Python27>c:\scripts\check.py
Traceback (most recent call last):
File "c:\scripts\check.py", line 1, in
import pycontrol.pyControl as pyControl
ImportError: No module named pycontrol.pyControl
I have never ran a python script before, so perhaps I am doing somehting wrong. Any help would be great.
Thanks.
EDIT:
I am now going another route based on a recommendation by Jason Rahm
Working on trying to get this to work, but having issues (See further down in the topic)
http://devcentral.f5.com/wiki/default.aspx/iRules/Pool_Member_Status_Page_on_a_Virtual_Server.html
- hoolio
Cirrostratus
Hi, - JRahm
Admin
that script is pycontrol v1. Don't go there... üôÇ!/usr/bin/python def show_all_pools_status(obj): ''' Show the status of all pools ''' try: pools = obj.get_list() status = obj.get_object_status(pool_names = pools) except: "Unable to fetch pool list or get status - check trace log" combined = zip(pools, status) for x in combined: print "Pool: ", x[0] print "\t", x[1].availability_status print "\t", x[1].enabled_status print "\t", x[1].status_description print "\n"*2 def show_pool_status(obj, pool_name = None): ''' show the status of a single pool ''' status = obj.get_object_status(pool_names = [pool_name]) combined = zip(pool_name, status) for x in combined: print "Pool: ", x[0] print "\t", x[1].availability_status print "\t", x[1].enabled_status print "\t", x[1].status_description print "\n"*2 if __name__ == "__main__": import pycontrol.pycontrol as pc Setup connection host = '10.10.20.5' uname = 'admin' upass = 'admin' b = pc.BIGIP( hostname = host, username = uname, password = upass, fromurl = True, wsdls = ['LocalLB.Pool'] ) p = b.LocalLB.Pool print "Fetching pool info...\n" show_all_pools_status(p) print "Fetching pool X info...\n" show_pool_status(p, ['testpool'])
- K-Dubb
Nimbostratus
Thanks for your help. I still cannot seem to get this to work. Just to confirm, I don't need to install anything on the load balancers themselves correct? I am basically needing somehting to show me the node status of all the nodes in every pool (we have 20 or so) without having to look at the poolstatus page on the F5. So somehting that exports to an html file, or something would work. I wanted to see what this looked like as it seemed to be close to what i needed, but not sure. - JRahm
Admin
no, the script should run from a remote machine (though it's possible to install pycontrol on your ltm: (Click Here) - K-Dubb
Nimbostratus
Wow, that sounds like it is exactly what I need (iRule version). I will try this. My only question is, once setup, how do you view the page? I did not see instructions for that in the link. - K-Dubb
Nimbostratus
I am having an issue with setting this up. On step 3, it mentions setting up the iRule. I do this, and then create the .class file in the class folder. When I try to click finsih, it gives me :The string class external file (/var/class/pool_member_status_list.class) has n invalid format, line: 1. It then deletes the file from that location. - JRahm
Admin
are you on v10+? If so, you need this one: - K-Dubb
Nimbostratus
Nope, I am on 9.4.8. - JRahm
Admin
what does your class look like? - K-Dubb
Nimbostratus
Posted By Jason Rahm on 06/17/2011 12:05 PM
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