Not getting any email 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.
Locked
sciencedicas
Posts: 15
Joined: Tue Dec 06, 2011 9:28 am

Not getting any email alerts

Post by sciencedicas »

Hello all.
I'm new into nagios,
I've install the core version 4 following the quick start.
I'm able to monitor few host and it's showing me the status, that seems fine.

the issue, is I'm NOT getting any email alerts. I taken the host down , and it shows down on the GUI but no email alerts

I did set up the contacts in the config.

also when I try to send a down notification from one of the host I got the error

Error: Could not stat() command file '/usr/local/nagios/var/rw/nagios.cmd'!
The external command file may be missing, Nagios may not be running, and/or Nagios may not be checking external commands.
An error occurred while attempting to commit your command for processing.

i set the permission to 777 on /usr/local/nagios/var/rw/nagios.cmd but still not working.

hope someone can hepl

thank you
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Not getting any email alerts

Post by lmiltchev »

Run the following commands and show us the output:

Code: Select all

service nagios status
ls -l /usr/local/nagios/var/rw
grep nag /etc/group
Be sure to check out our Knowledgebase for helpful articles and solutions!
sciencedicas
Posts: 15
Joined: Tue Dec 06, 2011 9:28 am

Re: Not getting any email alerts

Post by sciencedicas »

Sorry for the time reply, here is the command.

[root@ClearMon libexec]# service nagios start
nagios (pid 16960 16958 16957 16956 16955 16954) is running...
[root@ClearMon libexec]# ls -l /usr/local/nagios/var/rw
total 0
prwxrwxrwx. 1 nagios nagcmd 0 Jun 30 18:40 nagios.cmd
srw-rw----. 1 nagios nagcmd 0 Aug 7 16:30 nagios.qh
[root@ClearMon libexec]# grep nag /etc/group
nagios:x:501:snmptt
nagcmd:x:502:nagios,apache,snmptt
[root@ClearMon libexec]#
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Not getting any email alerts

Post by lmiltchev »

Change:
nagios:x:501:snmptt
to:

Code: Select all

nagios:x:501:nagios,apache,snmptt
Also, show us the host configuration, along with the associated template, contact, and commands.

Are you using sendmail for alerts? Can you send a test email from the CLI successfully to your contact's email?
Be sure to check out our Knowledgebase for helpful articles and solutions!
sciencedicas
Posts: 15
Joined: Tue Dec 06, 2011 9:28 am

Re: Not getting any email alerts

Post by sciencedicas »

Nothing happens when i send email from the CLI

I'm using this command
sendmail [email protected] subject body
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Not getting any email alerts

Post by slansing »

When you try to send the mail manually from the CLI, try a tail of the maillog to see if it is getting sent out, please post the output of the following after you have manually tried to send mail a couple times:

Code: Select all

tail -50 /var/log/maillog
Note: please filter out your email address/domain.
sciencedicas
Posts: 15
Joined: Tue Dec 06, 2011 9:28 am

Re: Not getting any email alerts

Post by sciencedicas »

thank you, its fixed now.

noticed with tail -50 /var/log/maillog that the email was being blocked by my exchange server.

I fixed that on the exchange my allow unauthenticated users to send email .
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Not getting any email alerts

Post by slansing »

Excellent, that's what I was hoping we'd find!
Locked