mail notifications

Marc Powell marc at ena.com
Sat Jan 24 17:05:26 CET 2004


Neil <mailto:neil-on-nagios at restricted.dyndns.org> wrote:
> Hi guys,
> 
> How will I modify the default alert/problem notifications that I am
> receiving by mail? I would like to add some text to the notification
> email.  


Just edit your host/service notify by email commands. They're basically
print statements sent to /bin/mail. Here's an example --

# 'service-notify-by-email' command definition
define command{
        command_name    service-notify-by-email
        command_line    /bin/echo -e "Subject: Service $SERVICEDESC$
$SERVICESTATE$ alert for $HOSTNAME$!\n\n***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
$SERVICESTATE$\nAddress: $HOSTADDRESS$\n\nService: $SERVICEDESC$\nInfo:
$OUTPUT$\n\nDate/Time: $DATETIME$\n" | /bin/mail -s '**
$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$
**' $CONTACTEMAIL$
        }

You'll need to restart nagios after making any modifications.

--
Marc


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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