Forum Discussion
Bret_McGinnis_1
Nimbostratus
Sep 09, 2005Clock time
I want to track the length of time that a pool is down and send a syslog message with the downtime in hours:minutes:seconds format. I'm still not that familiar with TCL and having some difficulty using the clock command. Can you provide some insight.
Regards,
- unRuleY_95363Historic F5 AccountWell, first, I would not recommend to heavily using the clock command until 9.2 as it does have a potential performance impact (however, it may not effect you enough to be concerned about it).
when RULE_INIT { array set ::down_nodes { } } when LB_FAILED { set cur_time [clock seconds] set server [LB::server addr] Has this member been down for more than one request if { [info exists ::down_nodes($server)] } { set delta [expr $cur_time - $::down_nodes($server)] Start logging after the member has been down for more than 60 secs if { $delta > 60 } { log local0. "Pool member [LB::server] down [clock format $delta -format {%H:%M:%S}]" } } set ::down_nodes($server) $cur_time } when LB_SELECTED { Clear out a down node that is now up if { [info exists ::down_nodes([LB::server addr])] } { unset ::down_nodes([LB::server addr]) } }
- Bret_McGinnis_1
Nimbostratus
Thank you. I just figured it out on my own. I think this is the second time that got an irule to work on my own and then checked my email only to find the answer waiting for me. - unRuleY_95363Historic F5 AccountIs there anything I should be careful about when using it (unset)?
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