Email notifications only going to nagiosadmin contact

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.
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Email notifications only going to nagiosadmin contact

Post by hazmat »

Hi there. I've looked all around but just cannot figure this out. This is a new install and all email notifications are going to nagiosadmin only. For a bunch of host definitions I have a specified 'contacts' directive for a contact I have defined in contacts.cfg. All checks out in the nagios config check. But whatever I try doing, no notifications will go to that contact defined in 'contacts' in the host definition; just nagiosadmin.

Thanks for any hints.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Email notifications only going to nagiosadmin contact

Post by dwhitfield »

Can you please post your nagios.cfg and your contacts.cfg? If you want to PM them for security purposes, that is fine. If you do PM them, please make sure you update this thread so it shows back up on our support dashboard.

Also, what happens if you run service nagios restart?

EDIT: files received and shared with techs
Last edited by dwhitfield on Tue Apr 04, 2017 12:13 pm, edited 1 time in total.
Reason: files received
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

Thanks! I will PM for security purposes. Restarting the nagios service shows no problems at all.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Email notifications only going to nagiosadmin contact

Post by dwhitfield »

Are you trying to use the contact group? I notice that there is only one member of the contact group. There is just one contact other than the nagiosadmin, is that correct?

Can you PM or post your /usr/local/nagios/var/objects.cache? Also, /usr/local/nagios/var/objects.precache may be useful if this ends up not being a configuration issue, but I think it is probably a configuration issue.
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

Sure, I'll PM those. I'm actually not using that group or the actual nagiosadmin contact for these. I'm using the other contact which you saw in my contacts.cfg.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Email notifications only going to nagiosadmin contact

Post by dwhitfield »

Please force something that should alert and then run the following commands:

Code: Select all

tail /usr/local/nagios/var/nagios.log
egrep '(warning|error|fatal|panic):' /var/log/mail.log | tail -100
alternatives --display mta
cat /etc/mailname
cat /etc/hostname
cat /etc/hosts
Many of your max_check_attempts are 10, so I wonder if that is the issue. All of the rest appear to be 3, which could still be an issue, though not as large. Could you set one of them to 1 for the purposes of testing?
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

Sure, no problem. These config files came from and old server with Nagios 3.2.0, for what that's worth. I didn't set the original server up, just took it over.
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

From the commands you wanted me to run, are you trying to see if Nagios is trying to send to the other contact's email but failing? In nagios.log it's ONLY trying to send to nagiosadmin. The emails to nagiosadmin send successfully. Do you still want any of that output?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Email notifications only going to nagiosadmin contact

Post by dwhitfield »

Well, part of what I wanted to see if whether they were going into a HARD down, but since you are getting emails, that's not the issue.

Can you PM or post your /usr/local/nagios/etc/objects/templates.cfg

What version of Core are you using? Was it compiled from source or installed from distro repos? On what OS/version is nagios running? cat /etc/*-release may be of use.

I looked at the contact objects for 3 vs. 4 and didn't see any differences, though knowing the version will let me look through the bug reports and changelog.
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Email notifications only going to nagiosadmin contact

Post by hazmat »

I'm running Nagios Core 4.3.1 on RHEL 7.3. I compiled it from source. Attached is my templates.cfg.
Attachments
templates.cfg
(10.53 KiB) Downloaded 162 times
Locked