Forum Discussion

Aaron_Chu_684's avatar
Aaron_Chu_684
Icon for Nimbostratus rankNimbostratus
Jun 15, 2006

LB::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
        }
}
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    If 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:
    if { [LB::status pool www-cache member 10.100.11.60 80] eq "up" } {
    (Added a note to that effect to the wiki page.)

    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:
    log local0. [LB::status pool www-cache member 10.100.11.60 80 up]
    HTH

    /deb
  • 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