Forum Discussion
uni
Altocumulus
May 25, 2011iRule to act on external events
I have a customer who wishes to redirect requests to their site depending on the existence of a flag file within their site. I can create a cron job or external monitor to test for the existence of this file, but want suggestions as to how to refer to this within my iRule.
Is there some way to check for a local file, or environment variable, within a rule applied to a virtual?
There may be another way of achieving the above requirement. I am open to suggestions.
5 Replies
- David_Windeyer
Nimbostratus
You could put a health monitor on a dummy node that hits the file and then use LB::status to see if it is up. - Michael_Yates
Nimbostratus
You could configure a Custom Health Monitor.
Send String:
GET /file.directory.inside.website/file.name.html\r\n
Receive String:
"Content Value String"
This will monitor for the holistic response from the monitored file (like if it only had the word "Active" in it, it would look for that in the receive string to determine if the node was available). - uni
Altocumulus
Posted By David Windeyer on 05/25/2011 02:38 AM
You could put a health monitor on a dummy node that hits the file and then use LB::status to see if it is up.
I like this, but how would I stop the dummy node from receiving client requests? - hoolio
Cirrostratus
I think Michael was suggesting that you create a pool and monitor without referencing the pool on a virtual server. This would allow you to monitor the pool member but not send any traffic to it. You could then check the state of the pool member using LB::status or of the pool using active_members:
http://devcentral.f5.com/wiki/default.aspx/iRules/lb__status
http://devcentral.f5.com/wiki/default.aspx/iRules/active_members
Aaron - uni
Altocumulus
Brilliant. Thanks Michael and Hoolio.
I didn't realise that a monitor is active in a pool even if the pool is not assigned to a virtual, but in hindsight this makes sense.
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
