Forum Discussion

Wallace1's avatar
Wallace1
Icon for Nimbostratus rankNimbostratus
Oct 31, 2014

iRule based on ltm policy

I am upgrading from pre-11.4 OS and I have an iRule that will check the status of the pool members selected based on a HTTPCLass. When I upgrade to 11.5.1, this rule does not work. For some reason the ltm policy must kick off after the iRule and I am unable to get the pool status.

 

The irule looks like this in 10.2.4:

 

when HTTP_CLASS_SELECTED { if { [HTTP::uri] ends_with "/status" } { set response "Virtual Server Diagnostic

 

" append response "Reported: [clock format [clock seconds]]

 

 

" foreach { selectedpool } [LB::server] { set thispool [getfield $selectedpool " " 1] if { [catch { if { [active_members $thispool] < 1 } { append response "Virtual Server [HTTP::host] is DOWN

 

" } else { append response "Virtual Server [HTTP::host] is UP

 

" Member Status Section for "UP" pools" foreach { pmem } [members -list $thispool] { append response " " append response "[join $pmem ":"] : [LB::status pool $thispool member [getfield $pmem " " 1] [getfield $pmem " " 2] ]

 

" } } } errmsg ] } { append response "$thispool ERRORInvalid pool name: $thispool" } } HTTP::respond 200 content $response "Content-Type" "text/html" } }

 

I am not sure how to call the ltm policy, any help would be greatly appreciated.

 

Thanks

 

1 Reply

  • R_Eastman_13667's avatar
    R_Eastman_13667
    Historic F5 Account

    Your code is a mess.

     

    Try executing in the HTTP_REQUEST event.

     

    HTTP_CLASS_SELECTED Replaced by the POLICY commands in v11.4.

     

    For details refer to sol14381: HTTP Class iRule events and commands are no longer available in BIG-IP 11.4.0 https://support.f5.com/kb/en-us/solutions/public/14000/300/sol14381.html