Nagios thinks it is sending notifications, but it is not

Lately, I’ve hardly been getting any Nagios notifications whatsoever. Being the cocky network admin that I am, I thought it was due to my rock solid infrastructure. Unfortunately, that is not true.

I found a few hosts and services that have notifications listed for them in the notification history page. I never received these messages.

I started to poke around in my postfix log and noticed that they never showed up there either.

I sent a test email from a terminal session, I got it. I sent a test email using the command that Nagios uses to send mail, I got it.

I restarted my Nagios box and then stopped a service that is being monitored. I got the notification. I started the service. I got the notification.

I edited my config to set a host to an IP address that doesn’t exist. Nagios says it sent the notification, but I never got it. It never showed up in my postfix logs.

Any ideas?

what is the command lines you’re using for sending emails? host-notify-by-mail
service-notify-by-mail

Hi,
I’ ve the same problem; I’ ve tried to send mail from telnet on port 25 and it’s ok, I’ ve tried to execute manually the notify-by-mail command and it works but mail of event notification does not arrive at all from Nagios.

I’ve Sendmail 8.13.8 and Nagios 2.9 on RHEL5

Last thing, nagios and sendmail run on a xen virtual machine.

Any ideas??

Anyone tried running the actual send command that nagios uses from a command prompt and seeing if it throws errors?
command-
/usr/bin/printf “***** Nagios *****\n\nNotification Type: Test\nHost: test\n” | /usr/bin/mail -s “Host test alert for test!” youremail@address

I just took the host-notify-by-email commad I have and removed the variables and shortened it for a test. Change the paths and run as the nagios user. See if you get something.

yes, i’ve tried it and mail arrive shortly…but when there’s a mail notification for some event in
Nagios the one does not arrive.

the command i execute from command-line is:
/usr/bin/printf “%b” “***** Nagios 2.9 ***\n\nNotification Type: \n\nService: \nHost: \nAddress: \nState: \n\nDate/Time: \n\nAdditional Info:\n\n" | /usr/sbin/sendmail -s " alert - is **” username@yourdomain

and mail arrive normally

I have since resolved my issue.

I found and replaced some bad syntax in the notify-by-email commands.

I would say that anyone having this problem should try reentering the notification commands per the defaults. See if that helps.