Confguring mutiple contacts in contact.cfg

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.
joshtate2001
Posts: 29
Joined: Wed Apr 08, 2015 1:55 pm

Confguring mutiple contacts in contact.cfg

Post by joshtate2001 »

I have a issue with Nagios not sending to all my contacts listed for the contact group.
I have a contact group name, "kourieradmins" with two contacts seperated by a comma.
I have tried it two ways; "joshtate,rcarter" and "joshtate, racarter". Basically with and without a space.

I does not matter how I do it. Nagios send the notification to the first contact only. If I switch it around to be "rcarter, joshtate"; rcarter get's the notification.
I followed the documention from Nagios, which states to use a comma for multiple contacts in a group. However it does not seem to work.
Notifications and groups are working fine. It just will not send to multiple contacts. It will only send to the first contact list in each contact group.

Help
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Confguring mutiple contacts in contact.cfg

Post by jdalrymple »

Post your whole contactgroup definition please.
joshtate2001
Posts: 29
Joined: Wed Apr 08, 2015 1:55 pm

Re: Confguring mutiple contacts in contact.cfg

Post by joshtate2001 »

Attached is my entire contacts.cfg file
Last edited by jdalrymple on Mon Aug 03, 2015 3:20 pm, edited 1 time in total.
Reason: Deleted attachment for your privacy's sake :) I have it downloaded and will post the revlevant bits.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Confguring mutiple contacts in contact.cfg

Post by jdalrymple »

Code: Select all

###############################################################################
# CONTACTS.CFG - SAMPLE CONTACT/CONTACTGROUP DEFINITIONS
#
#
# 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                           ***	; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
        }

define contact{
        contact_name                    amcintyre		; Short name of user
	use				generic-contact		; Inherit default values from generic-contact template (defined above)
        alias                           A Mcintyre		; Full name of user

        email                           ***	; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
        }

define contact{
        contact_name                    jtate		; Short name of user
	use				generic-contact		; Inherit default values from generic-contact template (defined above)
        alias                           J Tate		; Full name of user

        email                           ***	; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
        }		

define contact{
        contact_name                    joshtate2001		; Short name of user
	use				generic-contact		; Inherit default values from generic-contact template (defined above)
        alias                           J Tate Yahoo		; Full name of user

        email                           ***	; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
        }		

define contact{
        contact_name                    rcarter		; Short name of user
	use				generic-contact		; Inherit default values from generic-contact template (defined above)
        alias                           R Carter	; Full name of user

        email                           ***	; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
        }	

define contact{
        contact_name                    jwells		; Short name of user
	use				generic-contact		; Inherit default values from generic-contact template (defined above)
        alias                           J Wells	; Full name of user

        email                           ***	; <<***** 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
        }

define contactgroup{
        contactgroup_name       bbadmin
        alias                   Blackboard Administrators
        members                 amcintyre,rcarter,jwells,jtate
        }

define contactgroup{
        contactgroup_name       bbtransactadmin
        alias                   Blackboard Administrators
        members                 amcintyre,rcarter,jwells,jtate
        }		
		
define contactgroup{
        contactgroup_name       onbaseadmin
        alias                   Onbase Administrators
        members                 jtate,joshtate2001,jwells
        }			
		
define contactgroup{
        contactgroup_name       kourieradmin
        alias                   Kourier Administrators
        members                 jtate,joshtate2001,rcarter,jwells,amcintyre
        }

define contactgroup{
        contactgroup_name       colleagueadmin
        alias                   Colleague Administrators
        members                 jtate,joshtate2001,jwells,rcarter
        }

define contactgroup{
        contactgroup_name       doceserveeadmin
        alias                   Doc-e-Serve Administrators
        members                 jtate,joshtate2001,jwells,rcarter
        }

define contactgroup{
        contactgroup_name       ellucianmobileadmin
        alias                   Ellucian Mobile Administrators
        members                 jtate,joshtate2001,jwells,rcarter
        }

define contactgroup{
        contactgroup_name       informeradmin
        alias                   Informer Administrators
        members                 jtate,joshtate2001,jwells,rcarter
        }

define contactgroup{
        contactgroup_name       portaladmin
        alias                   Portal Administrators
        members                 jtate,joshtate2001,jwells,rcarter
        }

define contactgroup{
        contactgroup_name       webiadmin
        alias                   Webi Administrators
        members                 jtate,joshtate2001,jwells,rcarter
        }

define contactgroup{
        contactgroup_name       kronosadmin
        alias                   Kronos Administrators
        members                 jtate,joshtate2001,jwells,rcarter
        }

define contactgroup{
        contactgroup_name       recruiteradmin
        alias                   Recruiter Administrators
        members                 jtate,joshtate2001,jwells,rcarter
        }
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Confguring mutiple contacts in contact.cfg

Post by jdalrymple »

I pumped your contacts.cfg into a test system and applied the config. The resulting contactgroups look proper. For obvious reasons I'm not testing notifications with this config in place.

Code: Select all

define contactgroup {
        contactgroup_name       admins
        alias   Nagios Administrators
        members nagiosadmin
        }

define contactgroup {
        contactgroup_name       bbadmin
        alias   Blackboard Administrators
        members jtate,jwells,rcarter,amcintyre
        }

define contactgroup {
        contactgroup_name       bbtransactadmin
        alias   Blackboard Administrators
        members jtate,jwells,rcarter,amcintyre
        }

define contactgroup {
        contactgroup_name       colleagueadmin
        alias   Colleague Administrators
        members rcarter,jwells,joshtate2001,jtate
        }

define contactgroup {
        contactgroup_name       doceserveeadmin
        alias   Doc-e-Serve Administrators
        members rcarter,jwells,joshtate2001,jtate
        }

define contactgroup {
        contactgroup_name       ellucianmobileadmin
        alias   Ellucian Mobile Administrators
        members rcarter,jwells,joshtate2001,jtate
        }

define contactgroup {
        contactgroup_name       informeradmin
        alias   Informer Administrators
        members rcarter,jwells,joshtate2001,jtate
        }

define contactgroup {
        contactgroup_name       kourieradmin
        alias   Kourier Administrators
        members amcintyre,jwells,rcarter,joshtate2001,jtate
        }

define contactgroup {
        contactgroup_name       kronosadmin
        alias   Kronos Administrators
        members rcarter,jwells,joshtate2001,jtate
        }

define contactgroup {
        contactgroup_name       onbaseadmin
        alias   Onbase Administrators
        members jwells,joshtate2001,jtate
        }

define contactgroup {
        contactgroup_name       portaladmin
        alias   Portal Administrators
        members rcarter,jwells,joshtate2001,jtate
        }

define contactgroup {
        contactgroup_name       recruiteradmin
        alias   Recruiter Administrators
        members rcarter,jwells,joshtate2001,jtate
        }

define contactgroup {
        contactgroup_name       webiadmin
        alias   Webi Administrators
        members rcarter,jwells,joshtate2001,jtate
        }
So the contactgroup looks good. I guess what is the symptom... are you not getting the E-mails in your inbox, or are you able to confirm right in the notifications view that only the notification for the first contact is getting dispatched.

What does `grep NOTIFICATION nagios.log` reveal?
joshtate2001
Posts: 29
Joined: Wed Apr 08, 2015 1:55 pm

Re: Confguring mutiple contacts in contact.cfg

Post by joshtate2001 »

So, any ideas anyone?
joshtate2001
Posts: 29
Joined: Wed Apr 08, 2015 1:55 pm

Re: Confguring mutiple contacts in contact.cfg

Post by joshtate2001 »

What is happening is the first contact is being email and none of the rest.
All groups are working, but Nagios is only sending to the first contact of the contact group and the nagiosadmin contact.
Ideas? According to my config and Nagios documention; I have things correct.
joshtate2001
Posts: 29
Joined: Wed Apr 08, 2015 1:55 pm

Re: Confguring mutiple contacts in contact.cfg

Post by joshtate2001 »

The log is only going to show you the group being notified (dispatched), which is correct.
However, the first contact in the group is the only being sent a notification. The rest Nagios is ignoring and not sending a notification to.

From the log:

[1438575044] SERVICE ALERT: PortalWeb1;CPU Load;CRITICAL;HARD;3;CPU Load 99% (5 min average)
[1438575044] SERVICE NOTIFICATION: nagiosadmin;PortalWeb1;CPU Load;CRITICAL;notify-service-by-email;CPU Load 99% (5 min average)
[1438575644] SERVICE ALERT: PortalWeb1;CPU Load;OK;HARD;3;CPU Load 0% (5 min average)
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Confguring mutiple contacts in contact.cfg

Post by jdalrymple »

joshtate2001 wrote:The log is only going to show you the group being notified (dispatched), which is correct.
This is not the typical behavior of Nagios. Nagios will enter a line for each notification dispatched. You should never actually see a contactgroup in a notification event.

Can you post the output requested so we can verify this behavior on your system? If you are seeing different behavior it's no doubt related to your problem.

Code: Select all

grep NOTIFICATION nagios.log
joshtate2001
Posts: 29
Joined: Wed Apr 08, 2015 1:55 pm

Re: Confguring mutiple contacts in contact.cfg

Post by joshtate2001 »

I do not get anything when I run the command.
I have attached my nagios.log

Also, I copied the NOTIFICATION statement from the log into my previous reply.
Attachments
nagios.log
(39.13 KiB) Downloaded 593 times
Locked