Forum Discussion

4 Replies

    • RKC_260787's avatar
      RKC_260787
      Icon for Nimbostratus rankNimbostratus

      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
           } else  {
           return 0
           }
        } else {
           if { [active_members [LB::server pool]] < 1 } {
           HTTP::redirect "https://123test123.com/test"
      
      return 0
           }
        }
      

      }

  • 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