Forum Discussion
Angus_2141
Jul 16, 2013Historic F5 Account
redirect based on monitor status
I would like to have a process where I am able to redirect a user to site down for maintenance page based on status of monitor. My workflow would be using a monitor to check for the content of a fil...
Kevin_Stewart
Employee
Jul 29, 2013What you have already is a pretty interesting implementation. I'm assuming you have a separate pool and monitor for each member of the default pool? And testing those individually in the iRule?
Unfortunately, monitors do not currently return any information to iRules other that up/down status. Ultimately then, you need a way to reach into the management plane (where this information IS available) from the data plane (iRules), and there are a number of ways to do that. Here are a few ideas:
1. Maintain a (constantly updated) data group with pool member status information. When all of the pool members become unavailable, use an iRule to look into the data group for a reason.
2. Do the same thing with a stats profile - use a numbering system (ex. 0 = up, 1 = down, 2 = maintenance). The cool thing about a stats profile is 1) it can be written to and read from both planes, and 2) doesn't require a config update (like the data group option) every time it's updated.
3. Do the same thing with a session table - have a monitor push data to a session table (through a services VIP). This one requires a services VIP and iRule to catch the management plane (cURL) requests and post them to the table. This one also doesn't require config updates.
4. Sideband calls - given that you're only doing this process when all members are down, a sideband call could roll through the pool members looking for the "maintenance" flag.
There are of course many other ways to get data to/from the management plane to an iRule, but also consider this one other option. First, I'm also assuming you're waiting until all pool members are down and then splashing a maintenance page if at least one of them is in a maintenance mode. I would perhaps question whether it was a good idea to allow server maintenance to happen this way, second, simply display a maintenance page as a de facto response to all members down, and last, perhaps manage your maintenance mode events at the BIG-IP (explicitly) by using something like a data group flag (ex. maintmode := 1) to trigger the maintenance mode action when you've scheduled an outage.
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