nagios not notifying by email

Greg King wgking at shaw.ca
Tue Feb 21 08:15:11 CET 2006


The commands look correct. The one that works is using "mailx" and the one that fails is using "mail". I'd try mailx on the failing command, or verify that both work.

Hosts and services use different commands with different macros - make sure you are looking at the correct one (host-notify-by-email vs notify-by-email).

As for testing, I usually su - nagios; set env variables to the macro names, and copy/paste the commands into a shell until they work. Alternatively, use the check_dummy command with an error return code parameter. 

If notifications are happening you should see them in the notification log. If not, check parameters for notification on the host/service, timeframe, and contacts. 

Good luck!

Regards, Greg


> Date: Mon, 20 Feb 2006 16:02:48 -0500 (EST)
> From: Dave Stern <dave at umiacs.umd.edu>
> Reply-To: dave at umiacs.umd.edu
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] nagios not notifying by email
> 
> We have two iterations at our site, one running the old netsaint (which
> works flawlessly) and one running nagios 1.2 on RHEL E3-AS. The latter
> rebuilds its config files each night based on various site-specific
> files detailing what hosts we have, what to monitor on them etc.
> 
> The Linux version is not notifying when hosts/services go down. I suspect
> this is nothing more than the notify-by-email command.
> 
> On netsaint, it's
> 
> command[notify-by-email]=/usr/bin/printf '%s\n%s\n%s\n%s' '***** NetSaint
> 0.0.7 ***** $SERVICESTATE$ alert/notification'  'Host: $HOSTNAME$ Address:
> $HOSTADDRESS$', 'Additional Info: $OUTPUT$' | /usr/bin/mailx -s 'Service
> alert: $HOSTNAME$ is $SERVICESTATE$ **, $SERVICEDESC$' $CONTACTEMAIL$
> 
> and on linux its
> 
> # 'notify-by-email' command definition
> define command{
>          command_name    notify-by-email
>          command_line    /usr/bin/printf "%b" "***** Nagios
> *****\n\nNotificati
> on Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost:
> $HOSTALIAS$\nAddre
> ss: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time:
> $DATETIME$\n\nAdditional
>   Info:\n\n$OUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert -
> $HOSTALIAS$/$
> SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
>          }
> 
> Does anyone know what the command should look like and how to test the
> above?
> Thanks



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
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