Forum Discussion

squip_86995's avatar
squip_86995
Icon for Nimbostratus rankNimbostratus
Dec 10, 2013

iRule checking multiple "active_members" help

Hi All,

I'm currently building on-top of a couple of iRules I developed a while ago for our maintenance page - I'm extending the behaviour to also trigger a site failure page if everything fails (non-controlled take-down)

To do this I need to check the state of TWO pools -I would have assumed that this would be quite trivial with a simple logic operator... however I get the following error when attempting to Apply the iRule to a Virtual-server (so its already passed the first set of validation when saving the irule initially):

**_01070151:3: Rule [/Common/OopsPage2] error: Unable to find pool (Pool2) referenced at line 3: [active_members "Pool2"]_**

I've tried a couple of variations with different parenthesise combinations:

if { [active_members "Pool1" ] < 1 and [active_members "Pool2" ] > 0 }  {

AND

if { ([active_members "Pool1" ] < 1) and ([active_members "Pool2" ] > 0) }  {

Can someone spot the rookie mistake that I'm making? This works if I specify a single Pool to check. I am developing on LTM 11.1.0... I might also try this on 10.2.3

Thanks in advance for your help...

Regards,

Patrick

4 Replies

  • uni's avatar
    uni
    Icon for Altostratus rankAltostratus

    I couldn't see any problem. I reproduced it anyway, and my rule was accepted. Object names are case sensitive. Is it "Pool2" or "pool2"?

     

  • Hi Uni,

     

    Thanks for the swift reply... The name is indeed correct, however its formatted in the form of "PT-QA6-WEB_pool", the punctuation in the name wouldn't cause my issues would it?

     

    Thanks,

     

    Patrick

     

  • ...Well I finally figured it out, I think it was me just being stupid with my curly-braces "{}"

     

    I had prematurely closed the "when HTTP_Request" before my second pool-check statement could fire, thus closing the entire method and making the second piece of logic code inaccessible - Quite strange that the F5 threw the error that it did... But whatever... Notepad++ is your friend.

     

    Thanks for the help uni.

     

    -Patrick

     

    • uni's avatar
      uni
      Icon for Altostratus rankAltostratus
      I am always fighting the braces in TCL