This might be an easy one for some of you all. Iām trying to change the notification email subject line to read something like āServer1 is DOWNā or something along those lines. Is the command-plugins.cfg the place to do this? Itās the closest thing Iāve found. I commented out one line and added another, but after restarting the nagios service, I still end up with the same message. Any ideas???
(the original line that I commented out)
#command[notify-by-email]=/bin/printf ā$OUTPUT$ā | /bin/mail -s ā$SERVICESTATE$ alert for $HOSTALIAS$/$SERVICEDESC$ā $CONTACTEMAIL$
(the line i added)
command[notify-by-email]=/bin/printf ā$OUTPUT$ā | /bin/mail -s ā$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ā $CONTACTEMAIL$
Thanks!!!
Edited ]
Perhaps you donāt have your contacts.cfg correct. Check it.
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
You would then have to modify both for host and service, but what you have so far looks good.
thanks jakkedup! iāll check it next week when i get back to work and see what i can find.
I tried your command in the command line, and it works just fine.
Note: my printf is not in same place as yours i.e. /usr/bin/printf
/usr/bin/printf āOUTPUTā | /bin/mail -s āHOSTALIAS/SERVICEDESC is SERVICESTATEā [email protected]
When testing in the command line, you have to take out the dollar signs, since those wonāt be defined yet. So as I suspected, there is nothing wrong with your command, and it has to be elsewhere.
i had been editing the wrong file. iām not really sure what the command-plugins.cfg does, but the misccommands.cfg file is the one that needed to be changed. i changed the subject line there and now it works like a charm.