Forum Discussion
K-Dubb
Jun 17, 2011Nimbostratus
Posted By Jason Rahm on 06/17/2011 12:05 PM
what does your class look like?
I think this is what you want.
I have the code below in this path:/var/class/pool_member_status_list.class
when HTTP_REQUEST { if { [HTTP::uri] eq "/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" } if { [HTTP::uri] eq "/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" } }