Forum Discussion
Aaron_Chu_684
Nimbostratus
Jun 15, 2006LB::status not available in HTTP_REQUEST?
I have this iRule where I'm trying to check if a pool member is up before I send traffic to it, but I don't seem to be able to use the "[LB::status pool member up]" command.
This page says that the LB::status command (as written above) is supported in the HTTP_REQUEST event:
http://devcentral.f5.com/Wiki/default.aspx/iRules.LB__status
Here's my code:
when HTTP_REQUEST {
if { ( [HTTP::uri] contains "displayProfile.do" ) or ( [HTTP::uri] contains "displayGallery.do" ) } {
regexp -nocase -line {userid=([0-9]+)(&[=a-z0-9&]+)?$} [HTTP::query] wholeline userid
if { ( $userid ends_with "0" ) or ( $userid ends_with "1" ) } {
if { [LB::status pool www-cache member 10.100.11.60 80 up] } {
node 10.100.11.60 80
}
} elseif { ( $userid ends_with "2" ) or ( $userid ends_with "3" ) } {
node 10.100.11.61 80
} elseif { ( $userid ends_with "4" ) or ( $userid ends_with "5" ) } {
node 10.100.11.62 80
} elseif { ( $userid ends_with "6" ) } {
node 10.100.11.65 80
} elseif { ( $userid ends_with "7" ) } {
node 10.100.11.66 80
} elseif { ( $userid ends_with "8" ) or ( $userid ends_with "9" ) } {
node 10.100.9.21 80
} else {
pool www-cache
}
} else {
pool www
}
}2 Replies
- Deb_Allen_18Historic F5 AccountIf memory serves, I had some trouble with that command at first as well. This syntax in the example on the wiki page seems to work, though:
(Added a note to that effect to the wiki page.)if { [LB::status pool www-cache member 10.100.11.60 80] eq "up" } {
In most cases, if a command is not allowed in the event, you'd get a pretty specific error stating so: "command is not valid in current event context". If you're not getting a syntax error when you load the rule, the easiest way to figure out what's going wrong is often to log the results of the command that's giving you trouble:
HTHlog local0. [LB::status pool www-cache member 10.100.11.60 80 up]
/deb - Aaron_Chu_684
Nimbostratus
Thanks for the advice, but it hasn't helped. I've tried the following things:log local0. [LB::status pool www-cache member 10.100.11.60 80]log local0. [LB::status pool www-cache member 10.100.11.60 80 up]
The error message that shows is this:line 5: [undefined procedure: LB::status] [LB::status pool www-cache member 10.100.11.60 80]
Are these iRules validated using the iRule Editor or does the bigIP actually validate these? The www-cache pool does exist and the members are up according to tcp and http monitors.
Any chance that my bigIP OS needs an update? I'm running 9.1.1 Build 54.6
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
