Forum Discussion
If you just wanted to disable the pool members at a specific time of day, you could simply run an external monitor script that uses tmsh to do the job. Using an external monitor script has a few advantages: 1) if you keep the script in /config/monitors, it gets saved with the config when you archive, and 2) once assigned to a "dummy" pool (a pool that doesn't get assigned to a VIP), it executes at regular intervals like a cron job. You would then check the time on each execution and disable or enable the pool members if within the defined time span. Hopefully you have a good monitor on the actual VIP pool so that it knows the pools are down and takes some action.
If all you need to do is disable access to the VIP during a certain period though, and not necessarily disable the pool members, then an iRule like the following might also do the trick:
when RULE_INIT {
set static::START_OFF_TIME "05:30 AM"
set static::END_OFF_TIME "06:00 AM"
}
when HTTP_REQUEST {
set start_off_time [clock scan $static::START_OFF_TIME]
set end_off_time [clock scan $static::END_OFF_TIME]
set now [clock seconds]
if { ( [expr $now > $start_off_time] ) and ( [expr $now < $end_off_time] ) } {
HTTP::respond 200 content "Maintenance ModeMaintenance mode..."
}
}
This basically looks at the time of the request and compares it to a start and end time. If the current time is between these values it automatically responds with what could be arbitrary HTML content (ie. a maintenance page). If you wanted to be really crafty about it, you could also add a stream profile and inject a floating DIV banner and some JavaScript into the responses when the current time gets close to the down time - an impending maintenance event message and counter.