Forum Discussion
mr_evil_116524
Nimbostratus
May 19, 2015Question about maintenance window and time
Hello All,
So I have an iRULE for schedule maintenance window in our F5. This works great except for some reason is it removing the leading zero from minute, please see the iRULE below:
when...
JRahm
Admin
Jan 23, 2021I was helping on another time related thread and took some of the work here and modified. Hopefully this helps someone who has a maintenance window that crosses midnight.
when RULE_INIT {
set static::start_time 221500
set static::end_time 001459
set static::days [list "Wednesday" "Thursday"]
}
when HTTP_REQUEST {
#scan [clock format [clock seconds] -format {%A %H%M%S}] {%s %s} cur_day cur_time
### FOR TESTING PURPOSES ONLY ###
#scan [clock format [clock scan "Wed Jan 20 22:14:59 CST 2021"] -format {%A %H%M%S}] {%s %s} cur_day cur_time
#scan [clock format [clock scan "Wed Jan 20 22:15:00 CST 2021"] -format {%A %H%M%S}] {%s %s} cur_day cur_time
#scan [clock format [clock scan "Thu Jan 21 00:14:59 CST 2021"] -format {%A %H%M%S}] {%s %s} cur_day cur_time
#scan [clock format [clock scan "Thu Jan 21 00:15:00 CST 2021"] -format {%A %H%M%S}] {%s %s} cur_day cur_time
### END TESTING STRINGS ###
if { !(($cur_day eq [lindex $static::days 0]) && ($cur_time >= $static::start_time)) &&
!(($cur_day eq [lindex $static::days 1]) && ($cur_time <= $static::end_time)) } {
# NORMAL CONDITION
HTTP::respond 200 content "Situation: Normal. $cur_day, $cur_time "
} else {
# MAINTENANCE CONDITION
HTTP::respond 200 content "Situation: Maintenance. $cur_day, $cur_time "
}
}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