Hi again,
This rule works ok
when HTTP_REQUEST {
"clock seconds" will return the time in seconds
"clock format" will format the previous value with it's date/time components
split will chop the returned string into a list of elements.
Change the following to determine pool used and schedule
set PoolID "test_pool";
set StartTime "1030";
set StopTime "1430";
set StartDay "Thursday";
set StopDay "Thursday";
set l [split [clock format [clock seconds] -format {%A %H %M} ] " " ]
Next add the time check logic:
This example will process the log statement on Wednesday between 10:30 PM and 11:30 PM.
if {[lindex $l 0] eq "$StartDay" } {
set comptime [expr [lindex $l 1] * 100]
set comptime [expr $comptime + [lindex $l 2]]
if {($comptime >= $StartTime) && ($comptime <= $StopTime)} {
Put in iRule logic here
if { [IP::addr [IP::client_addr] equals XX.XX.XXXXX] } { pool $PoolID }
elseif { [IP::addr [IP::client_addr] equals XX.XXX.XXX.XXX] } { pool $PoolID }
else {reject}
}
}
}
but i need rule which will works with tcp(ssh virtual server), what should i change to use with CLIENT_ACCEPTED event(or any else event, I need it's functionality)?