Forum Discussion
K-Dubb
Jun 13, 2011Nimbostratus
Pool_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
- K-DubbNimbostratusI just tried that, but received the same result.
- K-DubbNimbostratusOk guys, I am still having issues here. THis is a highlevel of what I have done:
- hooleylistCirrostratusDo you see any errors in /var/log/ltm when you make a request to the virtual server?
- K-DubbNimbostratusNothing related, no.
- hooleylistCirrostratus...
- K-DubbNimbostratusHoolio I did not realize the address should be http://1.1.1.1/status! That is all it was. Works great!!
- hooleylistCirrostratusCan you use curl from the command line to make a request to the virtual server?
when HTTP_REQUEST { switch [HTTP::uri] { "/status" { set response "BIGIP Pool Member Status - \ [clock format [clock seconds]]BIGIP Pool Member Status - [clock format [clock seconds]]\ StatusPool NameMemberPort" foreach { selectedpool } $::pool_member_status_list { if { [catch { scan $selectedpool {%[^/]/%[^:]:%s} poolname addr port switch -glob [LB::status pool $poolname member $addr $port] { "up" { append response "UP\ [string tolower $poolname]$addr$port" } "down" { append response "DOWN\ [string tolower $poolname]$addr$port" } "session_enabled" { append response "ENABLED\ [string tolower $poolname]$addr$port" } "session_disabled" { append response "DISABLED\ [string tolower $poolname]$addr$port" } Default { append response "INVALID\ [string tolower $poolname]$addr$port" } } SWITCH END } errmsg] } { append response "INVALID\ [string tolower $poolname]$addr$port" } } append response "" HTTP::respond 200 content $response "Content-Type" "text/html" "Cache-Control" "no-cache, must-revalidate" "Expires" "Mon, 26 Jul 1997 05:00:00 GMT" } "/rss" { set response " \ BigIP Server Pool StatusServer Pool Status \ en[clock format [clock seconds]]\60" foreach { selectedpool } $::pool_member_status_list { if { [catch { scan $selectedpool {%[^/]/%[^:]:%s} poolname addr port switch -glob [LB::status pool $poolname member $addr $port] { "up" { append response "[string tolower $poolname] Status \ Member $addr:$port is UP" } "down" { append response "[string tolower $poolname] Status \ Member $addr:$port is DOWN" } "session_enabled" { append response "[string tolower $poolname] Status \ Member $addr:$port is ENABLED" } "session_disabled" { append response "[string tolower $poolname] Status \ Member $addr:$port is DISABLED" } Default { append response "[string tolower $poolname] Status \ Member $addr:$port is INVALID" } } SWITCH END } errmsg] } { append response "[string tolower $poolname] StatusMember $addr:$port is \ INVALID" } } append response "" HTTP::respond 200 content $response "Content-Type" "text/xml" "Cache-Control" "no-cache, must-revalidate" "Expires" "Mon, 26 Jul 1997 05:00:00 GMT" } default { HTTP::respond 200 content {Pool status VSPool status page Select a URI} } } }
- K-DubbNimbostratusThanks again for everyone's help.
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