Nagios does not send email notifications

ReynierPM rperezm at uci.cu
Wed Dec 9 14:43:12 CET 2009


Marc Powell wrote:
> On Dec 8, 2009, at 3:09 PM, ReynierPM wrote:
> 
> 
> You could use ls to see if they exist --
> 
> $ ls -l /usr/bin/printf /bin/mail
> -rwxr-xr-x 1 root mail 84856 Jan  7  2007 /bin/mail
> -rwxr-xr-x 1 root root 31496 Jan 21  2009 /usr/bin/printf
> 
> You could query your package system to verify if it's been installed. How to do so depends on your distribution. Under Redhat and clones it's --
> 
> [mpowell at noctools ~]$ rpm -q --whatprovides /usr/bin/printf
> coreutils-5.97-19.el5
> 
> [mpowell at noctools ~]$ rpm -q --whatprovides /bin/mail
> mailx-8.1.1-44.2.2
> 
> [mpowell at noctools ~]$ rpm -qa | egrep 'coreutils|mailx'
> coreutils-5.97-19.el5
> mailx-8.1.1-44.2.2
> 

Well I check all and the file exists at /usr/bin/mail so my services 
definitions is as follow

define command{
	command_name	notify-host-by-email
	command_line	/usr/bin/printf "%b" "***** Nagios *****\n\nNotification 
Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: 
$HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | 
/usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is 
$HOSTSTATE$ **" $CONTACTEMAIL$
}

# 'notify-service-by-email' command definition
define command{
	command_name	notify-service-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: 
$LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail 
-s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is 
$SERVICESTATE$ **" $CONTACTEMAIL$
}

But now checking logs I get this error:
[12-09-2009 07:53:34] SERVICE NOTIFICATION: 
nagiosadmin;bacula-server;Bacula Dir 
Daemon;UNKNOWN;notify-service-by-email;Remote command execution failed: 
Permission denied, please try again.

How can I fix this one?
Cheers
-- 
ReynierPM

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
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