Forum Discussion
Disable pool member using iRule
Hey Everyone,
I'm trying to disable a pool member using an HTTP request, so that my team and I don't need to be awake and online for server maintenance. Below are both of the rules I've tried to use to accomplish this. The second one works, but comes up on the next health check and the first one doesn't work at all.
These requests trigger off of an HTTP request like this http://10.10.10.100/down/10.15.15.150
I've included the logs that come up after using each iRule
when HTTP_REQUEST {
if {[scan [HTTP::uri] "/down/%s" server] == 1} {
LB::down node $server
log local0. "URI: [HTTP::uri] MATCHED. server=$server"
}
}
Nov 17 14:55:33 slb10mddcwi info tmm2[16157]: Rule /Common/PoolMemberDisable : URI: /down/10.15.15.150MATCHED. server=10.15.15.150
when HTTP_REQUEST {
if {[scan [HTTP::uri] "/down/%s" server] == 1} {
LB::down pool SOMEPOOL member $server 80
log local0. "URI: [HTTP::uri] MATCHED. server=$server"
}
}
Nov 17 14:53:28 slb10mddcwi err tmm1[16157]: 01010028:3: No members available for pool /Common/TestPoolForiRule
Nov 17 14:53:28 slb10mddcwi info tmm1[16157]: Rule /Common/PoolMemberDisable : URI: /down/10.15.15.150MATCHED. server=10.15.15.150 Nov 17 14:53:28 slb10mddcwi notice mcpd[6310]: 01070638:5: Pool /Common/TestPoolForiRule member /Common/172.18.95.107:80 monitor status iRule down. [ /Common/http: up ] [ was up for 0hr:0min:26sec ] Nov 17 14:53:28 slb10mddcwi notice mcpd[6310]: 01071682:5: SNMP_TRAP: Virtual /Common/TestVSForiRule has become unavailable Nov 17 14:53:28 slb10mddcwi notice mcpd[6310]: 01071912:5: Virtual Address /Common/10.10.10.100 general status changed from GREEN to RED. Nov 17 14:53:28 slb10mddcwi notice mcpd[6310]: 01071913:5: Virtual Address /Common/10.10.10.100 monitor status changed from UP to DOWN. Nov 17 14:53:28 slb10mddcwi err tmm2[16157]: 01010028:3: No members available for pool /Common/TestPoolForiRule Nov 17 14:53:28 slb10mddcwi err tmm3[16157]: 01010028:3: No members available for pool /Common/TestPoolForiRule Nov 17 14:53:28 slb10mddcwi err tmm[16157]: 01010028:3: No members available for pool /Common/TestPoolForiRule Nov 17 14:53:28 slb10mddcwi notice mcpd[6310]: 01070727:5: Pool /Common/TestPoolForiRule member /Common/172.18.95.107:80 monitor status up. [ /Common/http: up ] [ was iRule down for 0hr:0min:0sec ] Nov 17 14:53:28 slb10mddcwi notice mcpd[6310]: 01071681:5: SNMP_TRAP: Virtual /Common/TestVSForiRule has become available Nov 17 14:53:28 slb10mddcwi err tmm1[16157]: 01010221:3: Pool /Common/TestPoolForiRule now has available members Nov 17 14:53:28 slb10mddcwi err tmm2[16157]: 01010221:3: Pool /Common/TestPoolForiRule now has available members Nov 17 14:53:28 slb10mddcwi err tmm3[16157]: 01010221:3: Pool /Common/TestPoolForiRule now has available members Nov 17 14:53:28 slb10mddcwi err tmm[16157]: 01010221:3: Pool /Common/TestPoolForiRule now has available members Nov 17 14:53:32 slb10mddcwi notice mcpd[6310]: 01071912:5: Virtual Address /Common/10.10.10.100 general status changed from RED to GREEN. Nov 17 14:53:32 slb10mddcwi notice mcpd[6310]: 01071913:5: Virtual Address /Common/10.10.10.100 monitor status changed from DOWN to UP.Could an iRule be used to trigger a tmsh command or something along those lines to accomplish this?
Thanks
13 Replies
- Brad_Parker_139
Nacreous
Have you considered using a monitor with a receive disable string or just using the REST api to take the pool member offline?
- Brad_Parker_139
Nacreous
Here's a good explanation of a receive disable string. https://support.f5.com/kb/en-us/solutions/public/12000/800/sol12818.html - jjkast_230900
Nimbostratus
I'm open to all options. I'm just trying to take a little workload off of my team. - jjkast_230900
Nimbostratus
That might work. Do you have an example of using the REST api to do it too?
- Brad_Parker
Cirrus
Have you considered using a monitor with a receive disable string or just using the REST api to take the pool member offline?
- Brad_Parker
Cirrus
Here's a good explanation of a receive disable string. https://support.f5.com/kb/en-us/solutions/public/12000/800/sol12818.html - jjkast_230900
Nimbostratus
I'm open to all options. I'm just trying to take a little workload off of my team. - jjkast_230900
Nimbostratus
That might work. Do you have an example of using the REST api to do it too?
- jjkast_230900
Nimbostratus
I wouldn't really know how to do that. Do you have an example of one?
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
