help to troubleshoot configuration errors

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
yaoyao
Posts: 17
Joined: Fri Jul 05, 2013 3:14 pm

help to troubleshoot configuration errors

Post by yaoyao »

I added two contacts and two contact groups in contacts.cfg. However, I kept getting configuration errors.

Checking contact groups...
Error: Contact 'email-contact' specified in contact group 'email' is not defined anywhere!
Error: Contact 'pager-contact' specified in contact group 'pager-email' is not defined anywhere!
Error: Contact 'email-contact' specified in contact group 'pager-email' is not defined anywhere!

I think that the contacts are defined in contacts.cfg. Am I missing something?

My contacts.cfg is as follows:

define contact{
contact_name email-contact ; Short name of user
contactgroups email,pager-email
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
register 0
service_notification_period 24x7
host_notification_period 24x7
email <email address>
}

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 <email> ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}

define contact{
contact_name pager-contact ; Short name of user
contactgroups pager-email
service_notification_options c,r
host_notification_options d,u,r
service_notification_commands notify-service-by-pager
host_notification_commands notify-host-by-pager
register 0
service_notification_period 24x7
host_notification_period 24x7
pager <pager>
}

###############################################################################
###############################################################################
#
# 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 pager-email
members pager-contact,email-contact
}

define contactgroup{
contactgroup_name email
members email-contact
}
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: help to troubleshoot configuration errors

Post by abrist »

The directive:

Code: Select all

register 0
is reserved for templates. Remove the directive from your actual objects (like your particular contacts). If you look at the nagiosadmin contact, you will notice the distinct lack of a register directive. For more information, see:
http://nagios.sourceforge.net/docs/3_0/ ... tance.html
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.
yaoyao
Posts: 17
Joined: Fri Jul 05, 2013 3:14 pm

Re: help to troubleshoot configuration errors

Post by yaoyao »

That does it. It works now. Thanks a lot.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: help to troubleshoot configuration errors

Post by abrist »

No problem. Enjoy the week.
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