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 needs to be that the GTM will not issue DNS replies with IP addresses of Virtual servers that hold less than x number of nodes.
I figure that I need to create an irule on the Viprion that will monitor active_members of the pool and disable the pool once the minimum is breached.
Or can I do this on the Virtual Server level?
Could you good people give me a nudge in the right direction?
Thanks,
Itamar
13 Replies
Sort By
- The_Bhattman
Nimbostratus
Hi Itamar,nodes_up [ | ]
- Itamar_39103
Nimbostratus
Thanks Bhattman! - The_Bhattman
Nimbostratus
Hi Itamar,when HTTP_REQUEST { if {[HTTP::uri] eq "/status" } { set response "BIGIP Pool Status - [clock format [clock seconds]]" if { [active_members [LB::server pool] ] < 2 } { set response "$response DOWN - $selectedpool " } else { set response "$response UP - $selectedpool " } HTTP::respond 200 content $response "Content-Type" "text/html" } }
- Itamar_39103
Nimbostratus
Thanks Bhattman, - The_Bhattman
Nimbostratus
Hi Itamar,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" } }
- Itamar_39103
Nimbostratus
Bhattman, you are the king of IRules! - The_Bhattman
Nimbostratus
Glad it's working out for you.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 } { append response "DOWN - $poolname " } else { append response "UP - $poolname " } HTTP::respond 200 content $response "Content-Type" "text/html" } }
- The_Bhattman
Nimbostratus
HI Itamar, - The_Bhattman
Nimbostratus
This code has been published under samples: - Itamar_39103
Nimbostratus
Hi Bhattman,
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