Forum Discussion
CMP Compatible iRule
I have a iRule which is not CMP compatible , How to convert it to CMP compatible
- Samir_Jha_52506
Noctilucent
It will be good if you could explain more on this? Happy to help.
- RKC_260787
Nimbostratus
Hey, thanks for looking into it . here is the irule i am talking .
when RULE_INIT { set static::day {6} set static::start_time {0700} set static::end_time {1200} set static::check_interval 60 set static::check_time 0 set static::in_outage_window 0 }
when HTTP_REQUEST timing on { Use the TCL "clock" command to get the current time settings. set now [clock seconds] if { $now >= $static::check_time } { set static::check_time [expr $now + $static::check_interval] set raw_time [clock format $now -format {%u %H %M}] set raw_time [split [clock format [clock seconds] -format {%u %H %M}] " "] set cur_day [lindex $raw_time 0] set cur_time "[lindex $raw_time 1][lindex $raw_time 2]" set temp_outage_window 0 foreach dayidx $::day startidx $static::start_time endidx $static::end_time { if { ($cur_day eq $dayidx) && ($cur_time >= $startidx) && ($cur_time < $endidx) } { set temp_outage_window 1 log local0. "In outage" } } if {$temp_outage_window != $static::in_outage_window } { set static::in_outage_window $temp_outage_window if {$temp_outage_window == 0} { log local0. "End of outage" } else { log local0. "Start of outage" } } } if { $static::in_outage_window} { if { [active_members [LB::server pool]] < 1 } { HTTP::redirect ";
return 0
return 0} else { return 0 } } else { if { [active_members [LB::server pool]] < 1 } { HTTP::redirect "https://123test123.com/test"
} }
}
- Samir_Jha_52506
Noctilucent
Looks like hardware issue but Raise support ticket with F5 for more information.
- Lee_Sutcliffe
Nacreous
I've had a look at your iRule and there isn't anything there to suggest that it's incompatible with CMP (e.g. there aren't any TCP global variables such as $::var) As suggested by f5_rock, I would consider raising a case with F5
Recent Discussions
Related Content
* 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