Nagios not sending e-mail notification

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
homerkaro
Posts: 6
Joined: Mon Aug 25, 2014 6:38 am

Nagios not sending e-mail notification

Post by homerkaro »

Hi!
This is the first time I'm setting up Nagios but i can't get notifications working.
I get the following error in nagios log:
[Mon Aug 25 13:28:47 2014] SERVICE NOTIFICATION: nagiosadmin;srv0102vg;C:\ Drive Space;WARNING;notify-service-by-email;c:\ - total: 464,63 Gb - used: 385,00 Gb (83%) - free 79,63 Gb (17%)
[Mon Aug 25 13:28:47 2014] wproc: NOTIFY job 94 from worker Core Worker 31846 is a non-check helper but exited with return code 127
[Mon Aug 25 13:28:47 2014] wproc: host=srv0102vg; service=C:\ Drive Space; contact=nagiosadmin
[Mon Aug 25 13:28:47 2014] wproc: early_timeout=0; exited_ok=1; wait_status=32512; error_code=0;
[Mon Aug 25 13:28:47 2014] wproc: stderr line 01: /bin/sh: 1: /usr/bin/sendmail: not found
[Mon Aug 25 13:28:47 2014] wproc: stderr line 02: /usr/bin/printf: íráshiba: Broken pipe

What is wrong?
Thanks!
Daniel
homerkaro
Posts: 6
Joined: Mon Aug 25, 2014 6:38 am

Re: Nagios not sending e-mail notification

Post by homerkaro »

Ok i found it.
The sendmail is in /usr/sbin
Now I'm getting permission error:
[Mon Aug 25 15:24:30 2014] SERVICE NOTIFICATION: nagiosadmin;7120_baross;Yellow toner;WARNING;notify-service-by-email;Toner Warning - Yellow ink available: 7%
[Mon Aug 25 15:24:31 2014] wproc: NOTIFY job 6 from worker Core Worker 8516 is a non-check helper but exited with return code 78
[Mon Aug 25 15:24:31 2014] wproc: host=7120_baross; service=Yellow toner; contact=nagiosadmin
[Mon Aug 25 15:24:31 2014] wproc: early_timeout=0; exited_ok=1; wait_status=19968; error_code=0;
[Mon Aug 25 15:24:31 2014] wproc: stderr line 01: Program mode requires special privileges, e.g., root or TrustedUser.
[Mon Aug 25 15:24:31 2014] wproc: stdout line 01: WARNING: RunAsUser for MSP ignored, check group ids (egid=1001, want=127)
[Mon Aug 25 15:24:31 2014] wproc: stdout line 02: can not chdir(/var/spool/mqueue-client/): Permission denied
[Mon Aug 25 15:24:40 2014] SERVICE ALERT: srv0102vg;Total commander;CRITICAL;SOFT;5;TOTALCMD64.exe: not running
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios not sending e-mail notification

Post by lmiltchev »

Can you run the following commands and show us the output?

Code: Select all

ls -l /usr/sbin/sendmail
ls -l /var/spool
Be sure to check out our Knowledgebase for helpful articles and solutions!
Mapienator
Posts: 17
Joined: Thu Mar 26, 2015 10:09 am

Re: Nagios not sending e-mail notification

Post by Mapienator »

lmiltchev wrote:Can you run the following commands and show us the output?

Code: Select all

ls -l /usr/sbin/sendmail
ls -l /var/spool

I also have this problem.

Code: Select all

root@nagios:/usr/local/nagios/etc# ls -l /usr/sbin/sendmail
lrwxrwxrwx 1 root root 26 jun  1 12:18 /usr/sbin/sendmail -> /etc/alternatives/sendmail
root@nagios:/usr/local/nagios/etc# ls -l /var/spool
total 40
drwxr-xr-x 2 root   root  4096 mrt 23 13:58 anacron
drwxr-xr-x 3 root   root  4096 jul 22  2014 cron
drwx--x--- 3 root   lp    4096 jul 23  2014 cups
drwxr-xr-x 3 root   root  4096 jul 23  2014 libreoffice
drwxr-xr-x 2 root   root  4096 mrt 29  2014 lintian
lrwxrwxrwx 1 root   root     7 mrt 23 13:41 mail -> ../mail
drwxr-s--- 2 smmta  smmsp 4096 jun  1 13:42 mqueue
drwxrws--- 2 smmsp  smmsp 4096 jun  1 13:42 mqueue-client
drwxr-xr-x 2 root   root  4096 apr 11  2014 plymouth
drwx------ 2 syslog adm   4096 dec  4  2013 rsyslog
drwxrwxrwt 2 root   root  4096 feb 23 16:55 samba
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Nagios not sending e-mail notification

Post by jolson »

homerkaro, Mapienator,

What distributions are you using?

Code: Select all

cat /etc/*release
uname -a
[Mon Aug 25 15:24:31 2014] wproc: stdout line 02: can not chdir(/var/spool/mqueue-client/): Permission denied
You are right in thinking that this is likely a permission error. Do you have selinux/apparmor on?

Let's take a look at your users and groups, respectively:

Code: Select all

cat /etc/passwd
cat /etc/group
Which user is sendmail running as?
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Mapienator
Posts: 17
Joined: Thu Mar 26, 2015 10:09 am

Re: Nagios not sending e-mail notification

Post by Mapienator »

jolson wrote:homerkaro, Mapienator,

What distributions are you using?

Code: Select all

cat /etc/*release
uname -a
[Mon Aug 25 15:24:31 2014] wproc: stdout line 02: can not chdir(/var/spool/mqueue-client/): Permission denied
You are right in thinking that this is likely a permission error. Do you have selinux/apparmor on?

Let's take a look at your users and groups, respectively:

Code: Select all

cat /etc/passwd
cat /etc/group
Which user is sendmail running as?

I Found my problem already. Te home dir and the permissions on the Nagios user where corrupt for some reason. I just corrected that and rebooted the system. Works like a charm.

Still thanks!
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Nagios not sending e-mail notification

Post by jolson »

No problem.

homerkaro, let us know if you are still having troubles. Thanks!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked