Forum Discussion
Itamar_39103
Dec 24, 2009Nimbostratus
Bhattman, you are the king of IRules!
I had to fix a few bugs - the p of URI doesn't start wit a ? and there is no need for the LB::server..
here is the revised code:
when HTTP_REQUEST {
if {[URI::query [HTTP::uri] ] starts_with "p=" } {
set poolname [URI::query [HTTP::uri] p]
set minmember [URI::query [HTTP::uri] mmember]
set response "BIGIP Pool Status - [clock format [clock seconds]]"
if { [active_members $poolname ] < $minmember } {
set response "$response DOWN - $poolname
"
} else {
set response "$response UP - $poolname
"
}
HTTP::respond 200 content $response "Content-Type" "text/html"
}
}
What I have done is to set up a VS for HTTP with no members and an HTTP profile on the LTM and assigned the above Irule to the created VS.
then I have created a monitor on the GTM that monitors http with "GET ?p=TMs_blades&mmember=2 HTTP/1.0" in the send string and "/.*UP.*/" on the Receive strig.
on the alias address of the monitor I have entered the IP address of the http VS created above.
This works like a charm!
Thanks a million!