Forum Discussion
Formatting email alerts
I have been reading through several other posts about people trying to add a subject line to an email alert, but nobody seems to be able to figure out a way to do it on newer 11.x code using ssmtp. In addition to manipulating the subject line I would really like to figure out a way to format the email body. Right now I have the following configuration applied and it "works", but there has to be a way to dig in and format it.
alert BIGIP_GTMD_POOLMBR_SNMP_STATUS_CHANGE_X "Pool .*? member .*? state change .*? --> green"{
snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.52";
email toaddress="name@domain.com"
fromaddress="gtm@domain.com"
body="Alert cleared => Pool member state change to up"
}
alert BIGIP_GTMD_POOLMBR_SNMP_STATUS_CHANGE_WHY_X "Pool .*? member .*? state change .*? --> red .*?" {
snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.53";
email toaddress="name@domain.com"
fromaddress="gtm@domain.com"
body="New alert => Pool member state change to down"
}For example it would be great to be able to pull pieces and assign variables to them like $poolmember so later in the body I could say New alert => Pool member {$poolmember} state change to down. Don't get excited if you are looking for the same solution, because this doesn't work, but I sure wish it did.
alert BIGIP_GTMD_POOLMBR_SNMP_STATUS_CHANGE_X "Pool .*? member .*? state change .*? --> green"{
snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.52"
preg_match('/Pool.*?\s/',$this->trap,$poolmember);
email toaddress="name@domain.com"
fromaddress="gtm@domain.com"
subject="Alert cleared => {$poolmember[0]} is back up"
body="Pool member {$poolmember[0]} has returned to an up status"
}
alert BIGIP_GTMD_POOLMBR_SNMP_STATUS_CHANGE_WHY_X "Pool .*? member .*? state change .*? --> red .*?" {
snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.53"
preg_match('/Pool.*?\s/',$this->trap,$poolmember);
email toaddress="name@domain.com"
fromaddress="gtm@domain.com"
subject="New alert => {$poolmember[0]} is down"
body="Pool member {$poolmember[0]} has gone down"
}1 Reply
- nitass
Employee
For example it would be great to be able to pull pieces and assign variables to them like $poolmember so later in the body I could say New alert => Pool member {$poolmember} state change to down.
i do not think user_alert.conf is capable (as of now).
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