Forum Discussion

ichalis_37981's avatar
ichalis_37981
Historic F5 Account
Dec 29, 2005

Disable Node based on time of day

hi,

 

 

I am in the process of writing a rule that disables a node at a particular time each day. I have been experimenting with the clock command with the following rule fragment:

 

 

==========

 

when CLIENT_ACCEPTED {

 

set curtime [clock seconds]

 

set formattedtime [clock format $curtime -format {%H:%S} ]

 

log "the time is: $formattedtime"

 

==========

 

 

and have noticed that each time the event is triggered the time is different. Here is a snippet from the logs:

 

 

Dec 29 16:59:31 tmm tmm[5070]: 01220002:6: Rule test : the time is: 16:31

 

Dec 29 16:59:37 tmm tmm[5070]: 01220002:6: Rule test : the time is: 16:37

 

Dec 29 16:59:42 tmm tmm[5070]: 01220002:6: Rule test : the time is: 16:42

 

 

Am i doing something wrong? Is this a limitation of some sort?

 

 

Any other ideas how i could down a node at a particular time each day?

 

 

Any help would be much appreciated!

 

  • Seems you are using %H %S in place of %H %M. Hence the time displayed in the snippet is Hour:Sec, which keeps on changing.

     

     

    Hope this helps.