Nagios notifications not going through - no error message


#1

Hi,

I’m using nagios to monitor multiple host connected to our server.

Nagios is working, I can see the status of the site and everything. However. When a host goes down, no e-mail are sent out.

here is the notification command

host-notify-by-email /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATES$\nAdress: $HOSTADDRESS$\nInfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n” | /bin/mail -s “Host $HOSTSTATE$ alert for $HOSTNAME$@SERVER.SITENAME!” $CONTACTEMAIL$

Now, I have checked all Contact Groups, Contacts and Time Periods and they are fine. Next, I verified that the “mail” cdm is working

printf “%b” “Test with printf” | mail -s “Superb Test with printf” myname@myhost.com

I do receive the e-mail so the mail cmd is working.

Next step, check in nagios log.

It detects when the host goes down for Down, Unreachable, Recovery and an email has been sent to the right contacts with the command host-notify-by-email

Now for the funny part, that message is never to be received by me at the other end …

Any suggestion on what might be my the problem here ?

Running Red Hat 9 btw.


#2

Ok, I checke my “maillog”

Jul 12 13:04:22 irgaps02 sendmail[16375]: dangerous permissions=40755 on queue directory /var/spool/clientmqueue/
Jul 12 13:04:22 irgaps02 sendmail[16375]: j6CH4MCi016375: SYSERR(nagios): collect: Cannot write ./dfj6CH4MCi016375 (bfcommit, uid=101, gid=51): Permission denied
Jul 12 13:04:22 irgaps02 sendmail[16375]: j6CH4MCi016375: from=nagios, size=249, class=0, nrcpts=1, relay=nagios@localhost
Jul 12 13:04:22 irgaps02 sendmail[16375]: j6CH4MCi016375: 0: fl=0x0, mode=100644: dev=8/6, ino=245752, nlink=0, u/gid=101/102, size=249
Jul 12 13:04:22 irgaps02 sendmail[16375]: j6CH4MCi016375: 1: fl=0x1, mode=10600: FIFO: dev=0/5, ino=30882974, nlink=1, u/gid=101/102, size=0
Jul 12 13:04:22 irgaps02 sendmail[16375]: j6CH4MCi016375: 2: fl=0x8001, mode=20666: CHR: dev=8/6, ino=67001, nlink=1, u/gid=0/0, size=0
Jul 12 13:04:22 irgaps02 sendmail[16375]: j6CH4MCi016375: 3: fl=0x2, mode=140777: SOCK localhost->[UNIX: /dev/log]]
Jul 12 13:04:22 irgaps02 sendmail[16375]: j6CH4MCi016375: 4: fl=0x1, mode=20666: CHR: dev=8/6, ino=67001, nlink=1, u/gid=0/0, size=0
Jul 12 13:04:22 irgaps02 sendmail[16375]: j6CH4MCi016375: SYSERR(nagios): queueup: cannot create queue temp file ./tfj6CH4MCi0163

This is weird… It’s working perfectly with mail :?:!:?:? I did open permission yesterday because I had this problem on the mail command.

Is host-notify-by-email using sendmail even if i’m using mail or do sendmail and mail are the same thing ?? I’m “new” to the system administration world and learning things on linux everydays.


#3

printf “%b” “Test with printf” | mail -s “Superb Test with printf” myname@myhost.com

try this as nagios user…

Luca


#4

ok. Resolved the problem, now the message are going through.

Solution :
chmod 777 smmsp:smmsp clientmqueue
chmod 777 smmsp:smmsp mqueue — not for my case but might be for someone else.

Btw, thx for your suggestion.