Good Afternoon
I am having an issue with nagios and sendmail. I have both installed on a CentOS6 box. from the CMD line "I CAN" successfully send internally and externally. the emails come from [email protected]
however.. I CANNOT get nagios to send the alerts. I am using nagios 3.2.3 and here is some information below
this is from the maillog
rodan2 sendmail[1525]: STARTTLS=client, relay=mx1.emailsrvr.com., version=TLSv1/SSLv3, verify=FAIL, cipher=AES256-SHA, bits=256/256
rodan2 sendmail[1525]: r26M3Scb001522: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120311, relay=mx1.emailsrvr.com. [50.57.0.16], dsn=2.0.0, stat=Sent (Ok: queued as B6/33-12662-8ACB7315)
and this is from nagios.log
[1362604830] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios 1.0b6 *****\n\nNotification Type: PROBLEM\nHost: NagiosNAME\nState: DOWN\nAddress: 10.1.1.249\nInfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n" | /usr/bin/Mail -s "Host DOWN alert for NagiosNAME!" [email protected]" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
i know that the hostgroups.. contacts.. etc are all set up correctly, as I copied these from a working server...
I have also attached a copy of my commands.cfg
any help would be greatly appreciated...
Thanks
Brian
Nagios and SendMail configuration issues
-
brianweeks22
- Posts: 70
- Joined: Fri Dec 21, 2012 12:26 pm
Nagios and SendMail configuration issues
- Attachments
-
- commands-cfg.doc
- (20 KiB) Downloaded 200 times
Re: Nagios and SendMail configuration issues
Have you tried running the command from the cli as the *nagios* user? You have to make sure that nagios has rights to /usr/bin/Mail.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
brianweeks22
- Posts: 70
- Joined: Fri Dec 21, 2012 12:26 pm
Re: Nagios and SendMail configuration issues
I have /bin/mail - but under /usr/bin/ I only have mailq and mailq.sendmail.. Is this an issue?
is there a command that I can run to send as nagios user? or do i just log in as that user?
Thanks
is there a command that I can run to send as nagios user? or do i just log in as that user?
Thanks
Re: Nagios and SendMail configuration issues
Yes, and that would explain the following error:brianweeks22 wrote:I have /bin/mail - but under /usr/bin/ I only have mailq and mailq.sendmail.. Is this an issue?
You will need to alter the command to use one of the mail clients on your system. You may be able to symlink your mail binary to the notification command's expected location:brianweeks22 wrote:resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
Code: Select all
ln -s /bin/mail /usr/bin/MailYou can just su over to the nagios user before testing the command:is there a command that I can run to send as nagios user? or do i just log in as that user?
Code: Select all
su nagiosFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
brianweeks22
- Posts: 70
- Joined: Fri Dec 21, 2012 12:26 pm
Re: Nagios and SendMail configuration issues
Thank You
I can successfully send as nagios user.. I ran the cmd that you send ln -s /bin/mail /usr/bin/Mail
Nagios is still not sending? same error code 127
I can successfully send as nagios user.. I ran the cmd that you send ln -s /bin/mail /usr/bin/Mail
Nagios is still not sending? same error code 127
-
brianweeks22
- Posts: 70
- Joined: Fri Dec 21, 2012 12:26 pm
Re: Nagios and SendMail configuration issues
also, in command.cfg it already appears to be using /bin/mail which is where I DO have mail...
-
brianweeks22
- Posts: 70
- Joined: Fri Dec 21, 2012 12:26 pm
Re: Nagios and SendMail configuration issues
Actually... That worked... Let me wait 30 minutes before I close this, but I just received my first notification!
THANK YOU!
Brian
THANK YOU!
Brian
Re: Nagios and SendMail configuration issues
Great. Let us know when this thread is lock-ready. Cheers.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
brianweeks22
- Posts: 70
- Joined: Fri Dec 21, 2012 12:26 pm
Re: Nagios and SendMail configuration issues
It appears to be working well now!
Thanks for ALL of your help... Much appreciated
Thanks
Brian
Thanks for ALL of your help... Much appreciated
Thanks
Brian