[Solved] Nagios not sending alerts

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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios not sending alerts

Post by lmiltchev »

What is the output of the following command?

Code: Select all

which mail
Is sendmail actually running?

Code: Select all

service sendmail status
Try:

Code: Select all

service sendmail start
or

Code: Select all

service sendmail restart
Be sure to check out our Knowledgebase for helpful articles and solutions!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios not sending alerts

Post by tmcdonald »

If you plan on using postfix I would use the .../usr/sbin/sendmail.postfix binary. You can run the "file" command to make sure it is an ELF executable.

Otherwise if you wish to use mailx, run "which mailx" and that will show you the binary's location.
Former Nagios employee
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: Nagios not sending alerts

Post by jbruyet »

Ok, I changed the /usr/bin/mail command to /usr/sbin/postfix and then I tried sending another custom host notification. I'm getting the following message that gives me hope:

Code: Select all

Your command request was successfully submitted to Nagios for processing.

Note: It may take a while before the command is actually processed.

Done
But I never receive the message. The bottom of the Nagios log has this:

Code: Select all

[1406763948] EXTERNAL COMMAND: SEND_CUSTOM_HOST_NOTIFICATION;srv-FNW;0;nagiosadmin;Yet another test yet again
[1406763948] HOST NOTIFICATION: JobeePhone;srv-FNW;CUSTOM (UP);notify-host-by-email;PING OK - Packet loss = 0%, RTA = 0.13 ms;nagiosadmin;Yet another test yet again
[1406763949] wproc: NOTIFY job 96 from worker Core Worker 6904 is a non-check helper but exited with return code 1
[1406763949] wproc:   host=srv-FNW; service=(none); contact=JobeePhone
[1406763949] wproc:   early_timeout=0; exited_ok=1; wait_status=256; error_code=0;
I can't tell if I'm closer or just off in a different direction.

Thanks,

Joe B
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: Nagios not sending alerts

Post by jbruyet »

Oops! Sorry for the non sequitur post -- I didn't check for a second page. I'll get back with my results.

Thanks,

Joe B
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: Nagios not sending alerts

Post by jbruyet »

Hi lmiltchev, here are the results from your diagnostic steps:

Code: Select all

[root@Nagios jobee]# which mail
/bin/mail
[root@Nagios jobee]# service sendmail status
sendmail: unrecognized service
[root@Nagios jobee]#
For postfix all I did was a yum install. Did I miss a configuration step or two?

Thanks,

Joe B
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: Nagios not sending alerts

Post by jbruyet »

Thank you tmcdonald! Using sendmail.postfix did the trick after I removed the -s parameter. I just ran another custom host notification check and I received my text message in about five seconds. A big hearty thank you to everyone who helped with this issue.

Thanks,

Joe B
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios not sending alerts

Post by tmcdonald »

jbruyet wrote:Thank you tmcdonald! Using sendmail.postfix did the trick after I removed the -s parameter. I just ran another custom host notification check and I received my text message in about five seconds. A big hearty thank you to everyone who helped with this issue.
And a big hearty "You're welcome!" to you. Gonna lock this one up now.
Former Nagios employee
Locked