How to email notifications from Nagios

Potter, G M (Greg) GPotter at MarathonOil.com
Thu Dec 19 18:31:52 CET 2002


Here is my entry from commands.cfg and contacts.cfg that sends e-mail to me.  Hope this helps!

Greg


define command{
command_name notify-by-email
command_line /bin/echo "$ARG1$\n$ARG2$\n$ARG3$\n$PERFDATA$\n$OUTPUT$" | /usr/bin/mailx -s
 '**$SERVICESTATE$ alert for $HOSTALIAS$/$SERVICEDESC$ **' $CONTACTEMAIL$
}
define command{
command_name host-notify-by-email
command_line /bin/echo "$ARG1$\n$ARG2$\n$ARG3$\n$PERFDATA$\n$OUTPUT$" | /usr/bin/mailx -s
 '**$SERVICESTATE$ alert for $HOSTALIAS$/$SERVICEDESC$ **' $CONTACTEMAIL$
}
define contact{
        contact_name                    greg
        alias                           Greg Potter
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,u,r
        service_notification_commands   notify-by-email
        host_notification_commands      host-notify-by-email
        email                           gpotter at marathonoil.com
        }

> -----Original Message-----
> From: Giedrius Astrauskas net [mailto:gastrauskas at burrelles.com]
> Sent: Thursday, December 19, 2002 10:31 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] How to email notifications from Nagios
> 
> 
> Hi,
> 
> I have installed and configured Nagios to send notifications 
> by email. By
> looking at Notifications page I see that it correctly produces
> notifications, however it never actually sends them out.
> From reading Nagios documentation I got the impression that additional
> software is needed to actually email notifications, however I 
> could not find
> any sample or description how Nagios actually interacts with 
> such software.
> All I really need is a simple script to send emails. I am quite new to
> Linux, so please let me know if I am overlooking something.
> I would really appreciate any advice or information about 
> actually getting
> emails go out.
> 
> Thank you.
> 
> 
> Giedrius
> 
> 
> 
> -------------------------------------------------------
> This SF.NET email is sponsored by: Geek Gift Procrastinating?
> Get the perfect geek gift now!  Before the Holidays pass you by.
> T H I N K G E E K . C O M      http://www.thinkgeek.com/sf/
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> 


-------------------------------------------------------
This SF.NET email is sponsored by: Geek Gift Procrastinating?
Get the perfect geek gift now!  Before the Holidays pass you by.
T H I N K G E E K . C O M      http://www.thinkgeek.com/sf/




More information about the Users mailing list