Forum Discussion
apara_5691
Nimbostratus
Jul 07, 2010Check 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
- hoolio
Cirrostratus
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 - Chris_Miller
Altostratus
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}? - Michael_Yates
Nimbostratus
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. - apara_5691
Nimbostratus
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
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