Forum Discussion
Chad_Roberts_21
Nimbostratus
Aug 10, 2006Check pool status in an iRule
I am trying to write an iRule that will monitor the status of many devices before forwarding to one device. I'll try to skip the details unless it becomes necessary to explain, but is it possible to d...
Terje_Gravvold
Nimbostratus
Aug 10, 2006I don't realy know what you are trying to do, but here is a simple code that would do a status check on members of a pool.
set POOL01 "pool_my-pool"
array set POOL01_MEMBERS {
"10.1.1.40" "80"
"10.1.1.41" "80"
"10.1.1.42" "80"
"10.1.1.43" "80"
}
set LBSTAT ""
foreach {IP PORT} [array get POOL01_MEMBERS] {
if { $LBSTAT equals "" } {
set LBSTAT "$IP = [LB::status pool $POOL01 member $IP $PORT]"
}
else {
set LBSTAT "$LBSTAT, $IP = [LB::status pool $POOL01 member $IP $PORT]"
}
}
log local0. "$LBSTAT"
As much as I know you have to define the pool members both in the iRule and as members of a regular pool in the GUI. I don't know any way to extract the pool members from the BigIP config from an iRule.
You may also consider using [active_members ] if the only thing you want to check is the active members compared to how many members the pool have.
- Terje -
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