Forum Discussion
iRule to check for the page content and force-offline node in a pool
Hi,
I have a pool with 4 members and each server has a html page setup as /TomCatCount.html. If the count is high then the page will display "Above Threshold" and if the count comes down "Below Threshold"
Is there way to monitor the page content using iRule and get the particular pool members which has "Above Threshold" to set as Force-offline (LB::down)? I tried to use the monitor (using receive disable string) but it only disables the member. I need to Force-offline it.
2 Replies
Hi Venkat,
as I said, persistent session are transparently rebalanced to the next active node in the case that the persited node is unhealthy. You could check this behavior by using the iRule below. It uses the
event toPERSIST_DOWN
persisted node that have been failed. After[log]
has been triggered, a regularPERSIST_DOWN
event will occour, where one of the remaining nodes are getting selected...LB_SELECTEDwhen PERSIST_DOWN { log local0.debug "Persistent Node [LB::server addr] is marked as [LB::status]" set persist_down 1 } when LB_SELECTED { if { [info exists persist_down] } then { log local0.debug "New node selection is [LB::server addr]" unset -nocomplain persist_down } }To kill even the active session (Remark: Active Session =/= Peristent Sessions) to your backend systems, you have to query the currently [active_members] on every single TCP packet, that is going to be send to your pool members and then trigger a TCP::close or
if the currently selected node is not marked as "online"...rejectwhen SERVER_CONNECTED { TCP::collect } when SERVER_DATA { if { [active_members -list [LB::server pool]] contains [LB::server addr] } then { TCP::release } else { Use TCP::close to close the connection after the next response TCP::close User reject to terminate the request immediately reject } }Note: Keep in mind, that the iRule above produces a a huge performance overhead, since the
event and the containing script block is triggered on every single TCP packet that is send to your pool members.SERVER_DATACheers, Kai
Hi Venkat,
if a node is marked as "down" by an monitor, then its comparable to set this node manually as "Force-offline", since it does not receive any new and even persistent sessions.
The
command will force an fresh health monitor probe and would also mark the node temporary as "down" till the health monitor check has completed. The result of the health monitor will then keep the node "down" or flip it immediately back to "online". So i guess there is no benefit using this command...[LB::down]What the is your detailed requirement and what missing when a monitor is marking a node as "down"? Should LTM also kill any ongoing sessions to this node?
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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