Forum Discussion

apara_5691's avatar
apara_5691
Icon for Nimbostratus rankNimbostratus
Jul 07, 2010

Check monitor status from an iRule

Hi everyone!

 

 

I have a question. I have a VS that selecets the correct pool using an iRule, I want to check the status of that pool before it's selected (I mean, before 'pool $selected_pool' execution in the iRule) and, if it's possible, change the default monitor assigned to the pool?

 

 

If it's not possible (that's what I think), there's a way to perform a GET/something.html within a iRule or something similar to a monitor check?

 

 

Thanks in advance,

 

 

Alberto

 

4 Replies

  • Hi Alberto,

     

     

    You can check the status of a pool using LB::status:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/lb__status

     

     

    However there isn't a way to change the monitor assigned to a pool from an iRule. If a pool member was already marked down, you could use HTTP::retry to send a new HTTP request. You might be able to specify the IP and port to send that request to using the node command. I'm not sure whether this would work if the node address had also been marked down though.

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/http__retry

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/node

     

     

    Aaron
  • Posted By hoolio on 07/07/2010 05:16 AM

     

    Hi Alberto,

     

     

    You can check the status of a pool using LB::status:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/lb__status

     

     

    However there isn't a way to change the monitor assigned to a pool from an iRule. If a pool member was already marked down, you could use HTTP::retry to send a new HTTP request. You might be able to specify the IP and port to send that request to using the node command. I'm not sure whether this would work if the node address had also been marked down though.

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/http__retry

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/node

     

     

    Aaron

     

     

    Hoolio - what's your take on using LB::status vs if {active_members pool x > 0}?
  • Both can be useful, but it depends on what your after. Once is more specific than the other.

     

     

    The LB::status returns the status of a node address or pool member.

     

     

    The active_members returns the number of active members in the specified pool.

     

  • Thanks for the help guys, I'm a noob in the iRule world. I'm sure that your messages will be pretty useful

     

     

    Regards,

     

     

    Alberto