Current Pool Member Status

Problem this snippet solves:

Another variation of the "Pool_Member_Status_Page_on_a_Virtual_Server" This one specifically identified the status of a pool that is currently selected

NOTE: This iRule actually forces and early evaluation of the Load Balancing selection. Be advised that this may impact your load balancing criteria in other settings or irules within the same virtual services.

NOTE: This was designed for VIP carrying http. It was designed for other port types.

How to use this snippet:

This iRule requires LTM v10. or higher.

Code :

when HTTP_REQUEST { 
if {[HTTP::uri] eq "/status" } { 
scan [LB::select] %s%s%s%s%d command current_pool command2 current_member current_port
eval [LB::select] 
set response "$current_pool Pool Status - [clock format [clock seconds]]" 
if { [active_members $current_pool] < 1 } { 
append response "POOL NAME:$current_pool CURRENT MEMBER:$current_member:$current_port STATUS: DOWN " 
} else { 
append response "POOL NAME:$current_pool CURRENT MEMBER:$current_member:$current_port STATUS: UP " 
} 
} 
HTTP::respond 200 content $response "Content-Type" "text/html" 
}

Tested this on version:

10.0
Published Mar 17, 2015
Version 1.0
No CommentsBe the first to comment