.*Pool member 192.168.253.251:80 monitor status down.*
this one did not work.
Adding an error code in logger command caused it not to sent email alert.
I started deleting error code characters in the logger command one by one starting with the last character to figure out when it will start sending email alerts. Turns out that when error code is 01070638 email alert is sent. To me it means that something disagrees with having “:” in the error code when you want to send emails for custom alerts.
It seems like the alertd uses /var/run/bigip_error_maps.dat file when it receives log message that matches an alert code (on this case, it’s 01070638). The alertd process then performs the alert actions specified for that alert name in the /etc/alertd/alert.conf file.
body=“*** A pool member marked DOWN by monitor ***”
}
I found the Alert ID (BIGIP_MCPD_MCPDERR_POOL_MEMBER_MON_STATUS) from:
ltm grep 01070638 /var/run/bigip_error_maps.dat
0 LOG_NOTICE 01070638 BIGIP_MCPD_MCPDERR_POOL_MEMBER_MON_STATUS “Pool member %s:%u monitor status %s.”
It could be changed from /etc/alertd/bigip_mcpd_error_maps.h file
I could not find a way to only send the email for a specific pool member. As an alternative, you can use syslog-ng to run log2mail when it sees this message. For more information, go to syslog-ng and log2mail manual:
The idea was, and still is, to send email alerts out only when SPECIFIC pool member changes status..And send those email alerts only to SPECIFIC people who are responcible for those SPECIFIC pools..
Email notifications work great when using just a default alert.conf file..But when using alert.conf, email alerts were sent every time when ANY pool member was changing status..
what’s interesting, i have not had this issue when using 9.3.1… 9.4.4 and 9.4.6 do not allow me to use custom alerts..
FWIW, I am able to do custom alerts in 9.4.6 that send out SNMP traps.
alert EXPIRING_SSL_CERT "Certificate (.*) in file (.*) will expire on (.*)"
{ snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.500" }
Not sure why that works and an email version wouldn’t…
Denny
I guess it’s due to there is no alert code for EXPIRING_SSL_CERT or the log message. But when alertd receives input from syslog-ng utility that matches an alert code, the alert code is mapped to the alert name (taken from SOL6420).
But when alertd receives input from syslog-ng utility that matches an alert code, the alert code is mapped to the alert name (taken from SOL6420).
Ah, I was looking at his BIGIP_MCPD_MCPDERR_POOL_MEMBER_MON_STATUS_251 name and figured that wouldn’t match with the 251 added…so maybe it’s only matching over some X number of characters in the name?
Per this post (Click here), it looks like it’s just the order the alert definition is found for matching and not most specific. The poster in that thread said it worked when manually editing the alert.conf and putting the custom definition before the more general default alert. However, I like hwidjaja’s solution as it doesn’t involve editing a system file.