Unable to send emails

service_notification_commands notify-service-by-email
host_ notification_commands notify-host-by-email

Yes, they are called diffent names in v3. You do not need either of the above lines in the host object, they are for your contact objects and are already likely in the contact template. Take them out. And take out service_notification_period 24x7 and ‘email’ if you havent already, for the same reason.

hi,
I have tried that thatt, but i did not get any email alerts when the host is down.
Thakns,
512

That’s because you need to configure your email server to handle the notifications, and that is outside of nagios. As I have previously explained, Nagios isn’t an email application, it’s a monitoring application. If you look at those 2 notify commands you just posted, you will see they do a printf to /bin/mail… so if you still haven’t configured sendmail properly then it won’t know what to do with it when it gets passed on from the Nagios application.

hi,
But i am already using another syslog service in the same machine and am able to receive mails to my mail id. So i think there is no need of configuring my email server now. Am i correct?

Thanks,
512

If it uses an external call to /bin/mail to generate the email, then yes that changes things, but if it has a ‘built in’ mailserver in the syslog application that connects out to an smtp server itself then no. If you can tell how that sneds email then that would be useful. I’d be interested to see a tail of your /var/log/maillog (or whatever your mail server is logging to) as it should be showing you info on your outbound emails (generated both from nagios and the syslog software). Also, if you look at your sendmail.cf file you should recognise the configuration as being correct.