Forum Discussion
James_Thomson
Employee
Jul 25, 2005Question about No Nodes Available Rule
I recently posted this rule to emulate the 4.X feature that logged No Nodes available.
when LB_FAILED {
if { [LB::server addr] eq "" } {
log "No nodes available - pool [LB::server]"
...
unRuleY_95363
Jul 25, 2005Historic F5 Account
Improved version -
To take Joe's example one step further, you could use an array to count the errors per pool and only report the error every 50 times within each pool that fails (as opposed to every 50 times any pool fails).
when RULE_INIT {
Initialize the counter to 0.
array set ::log_ctr { }
}
when LB_FAILED {
if { [LB::server addr] eq "" } {
set pool [LB::server]
if { not [info exists ::log_ctr($pool)] or $::log_ctr($pool) >= 50 } {
log "No nodes available - pool $pool"
set ::log_ctr($pool) 0
} else {
incr ::log_ctr($pool)
}
}
}Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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