Page 1 of 1

Email alerts going to 53 recipients

Posted: Tue Apr 02, 2013 8:22 pm
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

Re: Email alerts going to 53 recipients

Posted: Wed Apr 03, 2013 9:49 am
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/

Re: Email alerts going to 53 recipients

Posted: Wed Apr 03, 2013 4:17 pm
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
}

Re: Email alerts going to 53 recipients

Posted: Wed Apr 03, 2013 4:32 pm
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

Re: Email alerts going to 53 recipients

Posted: Thu Apr 04, 2013 12:18 pm
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

Re: Email alerts going to 53 recipients

Posted: Thu Apr 04, 2013 12:21 pm
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

Re: Email alerts going to 53 recipients

Posted: Thu Apr 04, 2013 4:58 pm
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

Re: Email alerts going to 53 recipients

Posted: Thu Apr 04, 2013 7:42 pm
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

Re: Email alerts going to 53 recipients

Posted: Mon Apr 08, 2013 2:30 pm
by abrist
Your email commands are correct. Can you post a tail of the maillog and of /usr/local/nagios/var/nagios.log?