Forum Discussion
How to track a pool member status availability via i call script?
Hi Experts
How do I track a pool member status from i-call script? Pool-1 has nodes, node-1 and node-2. I need to track node-1 status and take action so that I can shut down another node in a different pool. I can not track only node since it can not be health checked by TCP/HTTP. Only ICMP health checks are not enough to give real status of App nodes. So I have to track individual pool member.
Will the below work or need to be edited more?
sys icall script /Common/down_event {
app-service none
definition {
This script is triggered via alertd and will only trigger when a pool member is DOWN
Node 1 status
set dev_objs [tmsh::get_status /ltm pool /Common/pool-1 member /Common/node-1:80]
foreach dev_obj $dev_objs {
set STATUS_1 [tmsh::get_field_value $dev_obj "status.availability-state"]
}
----------------------------------------------------
"If node-1 is down, disable another node NODE-1 as well"
----------------------------------------------------
tmsh::log " $STATUS_1"
if {($STATUS_1 == "Offline")}{
node reported as down
tmsh::log "Node-1 for pool-1 is down. DISABLING NODE-1 in pool-2"
tmsh::modify /ltm node NODE-1 state user-down
}
}
1 Reply
- cjunior
Nacreous
Hi,
Very interesting what you want to do.
Even so, why don't you do it by setting the specific monitor to that node?
So, if you create a TCP/HTTP monitor with a specific port, it should be able to use on node level.
Respectfully.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
