Email alerts going to 53 recipients

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
e2346437
Posts: 5
Joined: Tue Apr 02, 2013 8:14 pm

Email alerts going to 53 recipients

Post by e2346437 »

Hello,
Just put in a nice relaxing couple of hours getting Postfix to relay my Nagios alerts through an external email server. Problem is, Nagios is sending to 53 recipients even though my contacts.cfg only specifies my address in the admins group.

The addresses it's sending to are var@mydomain.net, root@mydomain.net, usr@mydomain.net...sys@, opt@, proc@...you get the drift. Basically, all the local accounts on my CentOS box. What is causing this and how to I fix?

Eric
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Email alerts going to 53 recipients

Post by slansing »

Lets start on the Nagios end, how do you have email notifications configured? Can you show us your contacts.cfg "blocking out sensitive information."

Also, it may be worth it to take a look at this guide and make sure that you covered everything already:

http://www.telnetport25.com/2012/02/con ... gios-core/
e2346437
Posts: 5
Joined: Tue Apr 02, 2013 8:14 pm

Re: Email alerts going to 53 recipients

Post by e2346437 »

Only added my email address to contacts.cfg, didn't touch anything else.

###############################################################################
# CONTACTS.CFG - SAMPLE CONTACT/CONTACTGROUP DEFINITIONS
#
# Last Modified: 05-31-2007
#
# NOTES: This config file provides you with some example contact and contact
# group definitions that you can reference in host and service
# definitions.
#
# You don't need to keep these definitions in a separate file from your
# other object definitions. This has been done just to make things
# easier to understand.
#
###############################################################################



###############################################################################
###############################################################################
#
# CONTACTS
#
###############################################################################
###############################################################################

# Just one contact defined by default - the Nagios admin (that's you)
# This contact definition inherits a lot of default values from the 'generic-contact'
# template which is defined elsewhere.

define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user

email me@mydomain.com <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}



###############################################################################
###############################################################################
#
# CONTACT GROUPS
#
###############################################################################
###############################################################################

# We only have one contact in this simple configuration file, so there is
# no need to create more than one contact group.

define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Email alerts going to 53 recipients

Post by scottwilkerson »

Can you post your generic-contact template along with the configs for the commands that it has specified for host_notification_commands & service_notification_commands

Also, can you verify that it is the nagios message that is being sent to them and not some bounce-back
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
e2346437
Posts: 5
Joined: Tue Apr 02, 2013 8:14 pm

Re: Email alerts going to 53 recipients

Post by e2346437 »

I think this is what you are looking for. hawkeye.cfg is the local Nagios host, and it had been throwing an HTTP warning even though HTTP is working fine. I just removed that check, but that is one of the errors that was creating the alerts to all the accounts on that server.

The message is in fact going to all 53 recipients. When I tail the maillog, and an alert goes out, there are 53 separate emails generated.

Eric
e2346437
Posts: 5
Joined: Tue Apr 02, 2013 8:14 pm

Re: Email alerts going to 53 recipients

Post by e2346437 »

Seems like Upload attachment didn't work...here is a dropbox link to a zipped archive containing the 4 config files https://dl.dropbox.com/u/31616175/Archive.zip
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Email alerts going to 53 recipients

Post by scottwilkerson »

So the nagios admin contact is set to deliver mail to me@domain.local? is that really in there or did you place it there to obfuscate the real value? Also, you didn't include the commands file so we can see what notify-service-by-email and notify-host-by-email are set to
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
e2346437
Posts: 5
Joined: Tue Apr 02, 2013 8:14 pm

Re: Email alerts going to 53 recipients

Post by e2346437 »

I put that address there to obfuscate the real value, but that's the only thing I changed.

commands.txt is attached.

Eric
Attachments
commands.txt
(7.86 KiB) Downloaded 358 times
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Email alerts going to 53 recipients

Post by abrist »

Your email commands are correct. Can you post a tail of the maillog and of /usr/local/nagios/var/nagios.log?
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.
Locked