Forum Discussion
Andrew_Lagomar1
Nimbostratus
Apr 13, 2017GTM DNS Time based iRule assistance needed
I am looking to create a GTM iRule where we can route away from Data Center 1 from 1AM - 2AM (maintenance) and from Data Center 2 from 2AM - 3AM (maintenance). I have created a wide IP and included ...
cjunior
Nacreous
Apr 13, 2017Hi, maybe you could do something like this:
GTM rule for wide ip:
when DNS_REQUEST {
set now [clock format [clock seconds] -format "%H:%M"]
Maintenance on DC 1
if { $now >= "01:00" and $now < "02:00" } {
VS DC 2
host 10.10.10.10
Maintenance on DC 2
} elseif { $now >= "02:00" and $now < "03:00" } {
VS DC 1
host 20.20.20.20
}
Otherwise, resolve from pool
}
DC 1 VS:
when HTTP_REQUEST {
set now [clock format [clock seconds] -format "%H:%M"]
if { $now >= "01:00" and $now < "02:00" } {
HTTP::respond 200 content {MaintenanceSorry!} noserver
}
}
DC 2 VS:
when HTTP_REQUEST {
set now [clock format [clock seconds] -format "%H:%M"]
if { $now >= "02:00" and $now < "03:00" } {
HTTP::respond 200 content {MaintenanceSorry!} noserver
}
}
Regards.
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