Package: nagios-common
Version: 1.4-3

The definition of notify-by-email and the like in
/etc/nagios/misccommands.cfg defines the body of the email to have a
last line NOT ending in a \n character.  GNU mailutils' mail will drop
these last lines.

For example, in the package source file
nagios-1.4/sample-config/default-object/misccommands.cfg.in:

command[notify-by-email]=/usr/bin/printf "%b" "***** Nagios @VERSION@ 
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: 
$HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: 
$DATETIME$\n\nAdditional Info:\n\n$OUTPUT$" | @MAIL_PROG@ -s "** 
$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" 
$CONTACTEMAIL$

needs to be:

command[notify-by-email]=/usr/bin/printf "%b" "***** Nagios @VERSION@ 
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: 
$HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: 
$DATETIME$\n\nAdditional Info:\n\n$OUTPUT$\n" | @MAIL_PROG@ -s "** 
$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" 
$CONTACTEMAIL$

else the contents of $OUTPUT$ don't make it into the email.  Similarly
for other commands utilising @MAIL_PROG@ where that may be GNU
mailutils' mail program.

It's simple to test this with two quick commandlines:

/usr/bin/printf "%b" "***** Testing *****\n\nWibble" | /usr/bin/mail -s "** 
test **" <user>
/usr/bin/printf "%b" "***** Testing *****\n\nWibble\n" | /usr/bin/mail -s "** 
test **" <user>

The first email will NOT have the line 'Wibble' in it, the second will.

Attachment: signature.asc
Description: Digital signature

Reply via email to