Forum Discussion
Itamar_39103
Nimbostratus
Dec 21, 2009disable virtual server if active members less than x
Hi all,
I am configuring a GTM machine to load balance DNS requests between virtual servers running on viprion machines.
One of the requirements of the configuration need...
The_Bhattman
Nimbostratus
Dec 23, 2009Hi 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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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