Forum Discussion
LEON_LI_38034
Nimbostratus
Sep 11, 2014The percentage of the total number of "active member", execute the TMSC modify command.
Hi All.
My customer have a request.
When total number of active's pool member less than 70% in WebPool,and then automatic disable LTM 1.1 interface.
When total number of active's pool membe...
JRahm
Admin
Sep 11, 2014You'll need to customize to only actually modify when there is a change in state rather than because the status is above/below the threshold (as I've shown below with the simple if/else condition), but this should get you started down the path:
foreach pn $pool_names {
set total 0
set usable 0
foreach obj [tmsh::get_status /ltm pool $pn detail] {
foreach member [tmsh::get''field''value $obj members] {
incr total
if { [tmsh::get''field''value $member pool-member.status.availability-state] == "available" &&
[tmsh::get''field''value $member pool-member.status.enabled-state] == "enabled" } {
incr usable
}
}
}
if { [expr $usable.0 / $total] < 0.7 } {
tmsh::modify /net interface 1.1 disabled
} else { tmsh::modify /net interface 1.1 enabled }
}
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