iRule Maintenance Windows
Published Apr 10, 2007
Version 1.0Was this article helpful?
My code from /check
"/check" {
Return the current time and the current settings for the maintenance window
set day [STATS::get $PROFILE_NAME "day"]
if { ($day < 1) } {
set day "No day set"
}
set start_time [clock format [clock scan [STATS::get $PROFILE_NAME "start_time"]] -format %H:%M]
set end_time [clock format [clock scan [STATS::get $PROFILE_NAME "end_time"]] -format %H:%M]
scan [clock format [clock seconds] -format {%A %k %M}] {%s %s %s} cur_day cur_hour cur_minute
set cur_time [clock format [clock scan now] -format %H:%M]
log local0. "\$cur_day: $cur_day, \$cur_hour: $cur_hour, \$cur_minute: $cur_minute, \$cur_time: $cur_time"
HTTP::respond 200 content [subst $::window_check_response]
}