Forum Discussion
The_Bhattman
Dec 23, 2009Nimbostratus
Hi Itamar,
Actually it wouldn't matter if your using Performance Layer 4 type virtual server. Because all you are doing is creating a virtual address to run an irule on the LTM that will look at any pool and provide you an UP or down based on active members.
Reworking my example you could also use an iRule that can query any pool within the LTM for up or down status based on their custom minimum members active. All you need is to create a custom monitor for each pool you want a status.
For example let's say you set up a monitor on GTM to look at
http://domainname.com/status?p=pool_layer4&mmember=2
Where p = pool member name and mmember = the minimum members active in the pool
The irule would return back an UP or DOWN on pool_layer4 based on the minimum. In the URL example string above if the members dropped below 2 then respond back with a DOWN.
Here is the iRule for the LTM.
when HTTP_REQUEST {
if {[URI::query] [HTTP::uri] p] 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 [LB::server $poolname] ] < $minmember } {
set response "$response DOWN - $poolname
"
} else {
set response "$response UP - $poolname
"
}
HTTP::respond 200 content $response "Content-Type" "text/html"
}
}
You might need to tweak it, since I have not tested it yet.
I hope this helps
Bhattman