Forum Discussion
Seems about right. Just tested with these settings, and it works.
[root@nielsvs-bigip:Active:Standalone] tmp # cat /config/user_alert.conf
alert TEST2 "Non-existent pool member for pool /Common/demo.app/demo_adfs_pool_443" {
exec command="/shared/bin/test.sh";
}
[root@nielsvs-bigip:Active:Standalone] tmp #
And the script. Make sure it is executable (chmod +x <filename>). You might also want to consider to put your scripts somewhere in the /shared/ directory. The data on this partition will still be available after an upgrade.
[root@nielsvs-bigip:Active:Standalone] tmp # cat /shared/bin/test.sh
#!/bin/bash
TCPDUMP="/sbin/tcpdump"
${TCPDUMP} -nni 0.0:nnn -s0 -w /var/tmp/test-$$.pcap -c1
[root@nielsvs-bigip:Active:Standalone] tmp #
And to show that it works:
[root@nielsvs-bigip:Active:Standalone] tmp # ls -ltra /var/tmp/test*
-rwxr-xr-x. 1 root root 22 Jul 19 2017 /var/tmp/test.sh
-rw-r--r--. 1 root root 427 Jun 13 15:27 /var/tmp/test-30157.pcap
-rw-r--r--. 1 root root 436 Jun 13 15:27 /var/tmp/test-31298.pcap
-rw-r--r--. 1 root root 432 Jun 13 15:27 /var/tmp/test-31293.pcap
-rw-r--r--. 1 root root 425 Jun 13 15:28 /var/tmp/test-3310.pcap
-rw-r--r--. 1 root root 425 Jun 13 15:28 /var/tmp/test-3314.pcap
-rw-r--r--. 1 root root 431 Jun 13 15:29 /var/tmp/test-7948.pcap
-rw-r--r--. 1 root root 431 Jun 13 15:29 /var/tmp/test-7943.pcap
-rw-r--r--. 1 root root 426 Jun 13 15:30 /var/tmp/test-12551.pcap
-rw-r--r--. 1 root root 436 Jun 13 15:30 /var/tmp/test-12555.pcap
-rw-r--r--. 1 root root 432 Jun 13 15:31 /var/tmp/test-17454.pcap
-rw-r--r--. 1 root root 432 Jun 13 15:31 /var/tmp/test-17458.pcap
-rw-r--r--. 1 root root 424 Jun 13 15:32 /var/tmp/test-21889.pcap
-rw-r--r--. 1 root root 426 Jun 13 15:32 /var/tmp/test-21884.pcap
-rw-r--r--. 1 root root 426 Jun 13 15:33 /var/tmp/test-26257.pcap
-rw-r--r--. 1 root root 426 Jun 13 15:33 /var/tmp/test-26253.pcap
-rw-r--r--. 1 root root 432 Jun 13 15:34 /var/tmp/test-30619.pcap
-rw-r--r--. 1 root root 432 Jun 13 15:34 /var/tmp/test-30614.pcap
[root@nielsvs-bigip:Active:Standalone] tmp #
The timer setting is in secs or mins? What do you think?
And I am trying to trigger it with this:
logger -p local0.notice "Pool /Common/pool_one member /Common/10.1.62.61:0 monitor status down."
Should I see an SNMP TRAP for this test logger command as well?
Normally I see this when a pool mon fails:
Jun 13 14:41:24 bigip2 notice mcpd[8183]: 01070638:5: Pool /Common/gateway-failsafe member /Common/10.1.62.61:0 monitor status down. [ /Common/gateway_icmp: down; last error: /Common/gateway_icmp: N
o successful responses received before deadline. @2019/06/13 14:41:24. ] [ was up for 0hr:0min:55sec ]
Jun 13 14:41:25 bigip2 notice mcpd[8183]: 01070638:5: Pool /Common/auction-php-pool member /Common/10.1.62.61:80 monitor status down. [ /Common/http: down; last error: /Common/http: Unable to connec
t; No successful responses received before deadline. @2019/06/13 14:41:25. ] [ was up for 0hr:0min:56sec ]
Jun 13 14:41:25 bigip2 notice mcpd[8183]: 01071682:5: SNMP_TRAP: Virtual /Common/auction-http-vs has become unavailable
Jun 13 14:41:25 bigip2 notice mcpd[8183]: 01071682:5: SNMP_TRAP: Virtual /Common/auction-https has become unavailable
How did you choose the msg ""Non-existent pool member for pool /Common/demo.app/demo_adfs_pool_443".
I think my msg is not matching the trap I configured, but why..?
- Jun 13, 2019
I've just selected a message from /var/log/ltm. The error message I've used is shown every minute in my log file. So that was an easy message to test with.
- davidfisherJun 13, 2019Cirrus
I am doing the same thing:
Jun 13 17:48:29 bigip2 notice mcpd[8183]: 01070638:5: Pool /Common/gateway-failsafe member /Common/10.1.62.61:0 monitor status down. [ /Common/gateway_icmp: down; last error: /Common/gateway_icmp: No successful responses received before deadline. @2019/06/13 17:48:29. ] [ was up for 0hr:0min:44sec ] Jun 13 17:48:30 bigip2 notice mcpd[8183]: 01070638:5: Pool /Common/auction-php-pool member /Common/10.1.62.61:80 monitor status down. [ /Common/http: down; last error: /Common/http: Tcp read: No route to host; Unable to connect @2019/06/13 17:48:30. ] [ was up for 0hr:0min:45sec ] Jun 13 17:48:30 bigip2 notice mcpd[8183]: 01071682:5: SNMP_TRAP: Virtual /Common/auction-http-vs has become unavailable Jun 13 17:48:30 bigip2 notice mcpd[8183]: 01071682:5: SNMP_TRAP: Virtual /Common/auction-https has become unavailable Jun 13 17:48:30 bigip2 notice mcpd[8183]: 010719e7:5: Virtual Address /Common/10.1.61.62 general status changed from GREEN to RED. Jun 13 17:48:30 bigip2 notice mcpd[8183]: 010719e8:5: Virtual Address /Common/10.1.61.62 monitor status changed from UP to DOWN.
And made the script chmod +x as well:
-rw-rw----. 1 mysql mysql 72 2019-06-12 15:15 #sql2bb7_c_0.MYD -rwxr-xr-x. 1 root root 2727 2019-06-13 14:27 Pool-tshoot-script.sh -rw-r--r--. 1 root root 137104 2019-06-13 17:17 logstatd.log
Did you change anything in the script itself? The timer?
- Jun 13, 2019
What timer do you refer to? I think it's best to test with a pool member actually going down. I'm not sure the logger command triggers the alert.
- Simon_BlakelyJun 13, 2019Employee
Events created via logger will trigger alertd.