Forum Discussion
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
" } else { append response "Virtual Server [HTTP::host] is
" 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 ERROR
I am not sure how to call the ltm policy, any help would be greatly appreciated.
Thanks
1 Reply
- R_Eastman_13667Historic 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
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