not receiving email alerts

craig craigc at nortelnetworks.com
Mon Nov 22 17:42:41 CET 2004


This is one for the archives:
Using Nagios 1.2
NagMIN 2.1.0
Solaris 8

Problem:
I was not receiving regular email alerts, or occasionally would get a
message from nagios, with a blank subject and blank body.

NagMIN seems to move the contents of misccommands.cfg to Command.cfg
Well, sort of...

This is what is uses:

define command {
    command_name    notify-by-email
    command_line    /usr/bin/printf \"%b\" \"***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional
Info:\n\n$OUTPUT$\" | /usr/bin/mail -s \"** $NOTIFICATIONTYPE$ alert -
$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **\" $CONTACTEMAIL$
}

I had to change it to:
define command {
    command_name    notify-by-email
    command_line    /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress:
$HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time:
$DATETIME$\n\nAdditional Info:\n\n$OUTPUT$" | /usr/bin/mailx -s "**
$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$
**" $CONTACTEMAIL$
}

- changed /usr/bin/mail to /usr/bin/mailx for Solaris
- removed extra "\"'s before " marks.

Also need to change host-notify-by-email


Craig Cook



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list