Page 2 of 2

Re: Email Notifications

Posted: Wed Oct 28, 2015 10:46 am
by jcwuerfl
Ok thanks. I will try that. So if its SMTP is there one for that ? Is there docs on each ?

Re: Email Notifications

Posted: Wed Oct 28, 2015 11:04 am
by tmcdonald
If you need to use SMTP, you will need to have an associated XI User and use the xi_host_notification handler and xi_service_notification handler commands for that User's contact. Otherwise, you will need to write a notification-handling script that can use SMTP, or configure Sendmail to work with SMTP. The following guides might help:

https://assets.nagios.com/downloads/nag ... ntacts.pdf
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... iables.pdf

Re: Email Notifications

Posted: Wed Oct 28, 2015 11:08 am
by jcwuerfl
Gotcha. I'll test w/ sendmail and those mail commands hopefully that will work with what I need to do.
Thanks!

Re: Email Notifications

Posted: Wed Oct 28, 2015 11:12 am
by tmcdonald
Sounds good! We can keep this thread open for a bit and if you have any questions/news feel free to update.

Re: Email Notifications

Posted: Wed Oct 28, 2015 11:25 am
by jcwuerfl
Perhaps this is a different issue but I did see the email alert. It was coming from a different email address with sendmail then I thought it would. Was the hostname of the VM but would like it to come accross with a different from address. Is that possible?

Second. Via the Web it seemed to take a long time for the problem to show up via the web interface? Not sure why that would be ? Almost a couple minutes?

Thanks.

Re: Email Notifications

Posted: Wed Oct 28, 2015 4:56 pm
by hsmith
jcwuerfl wrote:Perhaps this is a different issue but I did see the email alert. It was coming from a different email address with sendmail then I thought it would. Was the hostname of the VM but would like it to come accross with a different from address. Is that possible?
Yeah, you have to edit the command definition for notify-host-by-email and notify-service-from email. Depends on the distro, but for mine I had to put -a "From:[email protected]" right after the /usr/bin/mail command.
jcwuerfl wrote:Second. Via the Web it seemed to take a long time for the problem to show up via the web interface? Not sure why that would be ? Almost a couple minutes?
Where on the Web UI do you mean?

Re: Email Notifications

Posted: Wed Oct 28, 2015 5:04 pm
by ssax
If you used notify-host-by-email and notify-service-by-email you would edit those commands in your /usr/local/nagios/etc/commands.cfg, I believe adding a -r [email protected] to the mail command should make it work, you should test it from the command line first though.

Code: Select all

echo 'testing' | mail -s "TEST" [email protected] -r [email protected]
For your second issue, are you saying that you received the notification but it didn't show up in the interface until a few minutes later? Did you manually refresh the page?