Forum Discussion
Tim_Moomaw_9220
Nimbostratus
Nov 09, 2008Scheduled Maintenance Window
--- Obligatory "I'm new to iRules" ----
I'm trying to create a rule to return a maintenance page every Saturday morning between 0200 and 0600. I have copied a few examples ...
Jonathan_H_4580
Nimbostratus
Jun 13, 2011Hi,
I need to be able to specify a calendar date and time for my maintenance window rather than a recurring day of the week. To do this I have attempted to use the iRule that Johan suggested above on 3/10/2011. I modified it slightly so that a particular pool will be used during my maintenance window -- see below for my rule. HOWEVER, when I test the rule it fails to take effect!!! Any suggestions would be much appreciated.
Thanks, Jonathan
Note syntax is "date/month hour:minute"; and hour should NOT start with zero.
when HTTP_REQUEST {
set start "29/5 18:45"
set end "29/5 18:50"
scan [clock format [clock seconds] -format {%m %d %k %M}] {%d %s %s %s} cur_month cur_day cur_hour cur_minute
scan $start {%d/%d %d:%d} start_day start_month start_hour start_minute
scan $end {%d/%d %d:%d} end_day end_month end_hour end_minute
set start {expr (${start_month}000000 + ${start_day}0000 + ${start_hour}00 + ${start_minute} )}
set end {expr (${end_month}000000 + ${end_day}0000 + ${end_hour}00 + ${end_minute} )}
set cur_time ${cur_month}${cur_day}${cur_hour}${cur_minute}
if { $cur_time >= $start and $cur_time < $end} {
pool MAINT-POOL
}
}
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