Page 1 of 1

help to troubleshoot configuration errors

Posted: Mon Aug 05, 2013 2:38 pm
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
}

Re: help to troubleshoot configuration errors

Posted: Mon Aug 05, 2013 3:32 pm
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

Re: help to troubleshoot configuration errors

Posted: Mon Aug 05, 2013 4:13 pm
by yaoyao
That does it. It works now. Thanks a lot.

Re: help to troubleshoot configuration errors

Posted: Mon Aug 05, 2013 4:14 pm
by abrist
No problem. Enjoy the week.