Junzo
Oct 20, 2021Nimbostratus
iRule for sorry page and Maintenance page
Hi
Implemented 2 iRule to 1 Virtual Server.
Sorry.html and Maintenance.html page.
Both are working properly individually.
case1: server down -> sorry.html
case2: maintenance time -> maintenance.html
However, during the Maintenance period, once the server is down, no page show. just IE error "This page can't be displayed".
case3: maintenance time and server down -> (Expect) maintenance.html -> (result) IE error.
Can I get any suggestions? configuration or iRules.
iRule 1
when HTTP_REQUEST {
set maintenance_start_time "0000";
set maintenance_end_time "2359";
set maintenance_day "Sunday";
scan [clock format [clock seconds] -format {%A %k %M}] {%s %s %s} cur_day cur_hour cur_minute
set cur_time ${cur_hour}${cur_minute}
if { ($cur_day eq $maintenance_day) &&
($cur_time >= $maintenance_start_time) &&
($cur_time <= $maintenance_end_time) } {
HTTP::respond 200 ifile "/Common/maintenance.html"
}
}
iRule 2
when HTTP_REQUEST {
if { [active_members Pool_A] < 1 } {
HTTP::respond 200 ifile "/Common/sorry.html"
}
Best Regards