Custom iRule or Monitor with GTM/LTM Integration
I have a bit of a dilemma with our LTM and integrating with intelligent DNS, e.g. GTM.
Scenario:
Our LTM inspects backend servers using an HTTP monitor. It checks a URI, /in.html, if the node returns with a '200 OK' in the header, the node is marked as up. If we get a timeout, 404, etc, the server is marked as down. This allows server-admins to manage node-state on the F5 by scripting changes to this file in addition to marking HTTP nodes down when they fail.
Tied to this I have an iRule applied to each virtual-server. When all nodes in a pool fail, the F5 will present an under-maintenance page hosted on the LTM. So when either planned or unplanned incidents occur on backend servers, customers are presented with a maintenance page instead of a timeout.
Problem:
This works great if you only have a single site, but we are looking to run multiple sites with a GTM monitoring each public IP. I would like to implement the same behavior with the GTM as our LTM.
- GTM probes public LTM vip for /dns.html URI.
- 200 OK = Site up
- Timeout/404/etc. = Site down
Seems simple, but not in tandem with my maintenance configuration. We need three states.
- Site up, i.e. 200 OK on both /dns.html & /in.html.
- Planned maintenance, i.e. GTM 200 OK on /dns.html. LTM timeout on /in.html.
- Unplanned maintenance. This is the issue...
How can I configure my maintenance iRule so that the /dns.html times-out when GTM probes it while still providing the "Planned Maintenance" state? Currently if the servers crashed and GTM probed the VIP, it would get a 200 OK on that URI because the LTM is presenting it the maintenance page.
I know you can implement two monitors per-pool and only pass if all monitors are up, but I need logic so that it has three states, not two. Is this possible with a custom iRule monitor?
Can I check the status of monitors in an iRule? I.e. 'if monitor a = up do x, if monitor b = up do y, if monitor a & b = down do z'?