Change notification email subject?

This might be an easy one for some of you all. :slight_smile: 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!!! :slight_smile:
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. :wink:

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. :slight_smile: