Forum Discussion
Roman_80473
Nov 17, 2011Nimbostratus
Detect if node is half-dead with an iRule?
Hi folks,
I was tasked to monitor app servers in the pool with an iRule (LTM 10.2). I wrote a simple rule which does the following:
if I get into LB_FAILED, I take the node out and res...
nitass
Nov 18, 2011Employee
1 using LB::detach + LB::reselect
[root@ve1023:Active] config b rule myrule list
rule myrule {
when RULE_INIT {
set static::response_timeout 5
}
when HTTP_REQUEST {
log local0. "Received request, beginning response monitor interval. [clock seconds]"
set monitor_id [\
after $static::response_timeout {
LB::detach
LB::reselect pool foo2
log local0. "Timeout $static::response_timeout milliseconds elapsed without server response. [clock seconds]"
}\
]
}
when HTTP_RESPONSE {
log local0. "Received server response."
if {[info exists monitor_id]} {
log local0. "Canceling after script with id $monitor_id"
after cancel $monitor_id
}
}
}
curl -i http://172.28.19.79
...no response...
[root@ve1023:Active] config tail -f /var/log/ltm
Nov 18 09:52:49 local/tmm notice tmm[24220]: 013e0001:5: Tcpdump starting bcast on :::0 from 127.1.1.1:42905
Nov 18 09:52:59 local/tmm info tmm[24220]: Rule myrule : Received request, beginning response monitor interval. 1321638779
Nov 18 09:52:59 local/tmm info tmm[24220]: Rule myrule : Timeout 5 milliseconds elapsed without server response. 1321638779
[root@ve1023:Active] config tcpdump -nni 0.0 port 80 or port 88
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on 0.0, link-type EN10MB (Ethernet), capture size 108 bytes
09:52:59.853876 IP 172.28.19.253.49633 > 172.28.19.79.80: S 1454416003:1454416003(0) win 5840
09:52:59.853911 IP 172.28.19.79.80 > 172.28.19.253.49633: S 1517764163:1517764163(0) ack 1454416004 win 4380
09:52:59.855952 IP 172.28.19.253.49633 > 172.28.19.79.80: . ack 1 win 46
09:52:59.855977 IP 172.28.19.253.49633 > 172.28.19.79.80: P 1:155(154) ack 1 win 46
09:52:59.856051 IP 200.200.200.10.49633 > 200.200.200.101.88: S 3113407707:3113407707(0) win 4380
09:52:59.857029 IP 200.200.200.101.88 > 200.200.200.10.49633: S 1833697333:1833697333(0) ack 3113407708 win 5792
09:52:59.857038 IP 200.200.200.10.49633 > 200.200.200.101.88: . ack 1 win 4380
09:52:59.857047 IP 200.200.200.10.49633 > 200.200.200.101.88: P 1:155(154) ack 1 win 4380
09:52:59.857983 IP 200.200.200.101.88 > 200.200.200.10.49633: . ack 155 win 54
09:52:59.860978 IP 200.200.200.10.49633 > 200.200.200.101.88: F 155:155(0) ack 1 win 4380
09:52:59.861895 IP 200.200.200.101.88 > 200.200.200.10.49633: F 1:1(0) ack 156 win 54
09:52:59.861909 IP 200.200.200.10.49633 > 200.200.200.101.88: . ack 2 win 4380
09:52:59.955864 IP 172.28.19.79.80 > 172.28.19.253.49633: . ack 155 win 4534
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