Forum Discussion
ichalis_37981
Dec 29, 2005Historic F5 Account
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!
- Ravi_Rajan_7549
Nimbostratus
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. - ichalis_37981Historic F5 AccountAhhh!!! thanks for that - dumb mistake!!
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects