Config Verification fails

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ajwusv
Posts: 28
Joined: Tue Jul 05, 2011 10:13 am

Re: Config Verification fails

Post by ajwusv »

yes i tried that as you had recommended it in a previous post and it failed with the same error.

i will post the file up shortly.
Nagios XI
32 bit VM Image - 2011 R2.2
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Config Verification fails

Post by mguthrie »

OK, lets pause before we go any further and read this FAQ on troubleshooting configuration errors.
http://support.nagios.com/wiki/index.ph ... leshooting

When you use the "Apply Configuration" button, Nagios XI will roll back a config to it's last known good configuration if it detects a configuration error in order to keep the monitoring engine running. So my guess is that the contact config that was posted that we're attempting to troubleshoot from has no errors in it. The contact config that we need to look at it in the most recent (bad) Configuration Snapshot tarball, which should be highlighted in red.

Note the error message:
Error: Template '' specified in contact definition could not be not found (config file '/usr/local/nagios/etc/contacts.cfg', starting on line 14)


Template (empty string) is being referenced in this error. I'm wondering if somehow there's an extra comma or something in the "use" field for the contact that starts on line 14.

If you want to see what the Core Config Manager is generating as a config before you write to file, click the "Download" button or icon on the page that has all of the listings. This will tell us what's being written to file.

Have you made any manual edits to the contacts.cfg file?
ajwusv
Posts: 28
Joined: Tue Jul 05, 2011 10:13 am

Re: Config Verification fails

Post by ajwusv »

I tried manual edits at one point but after trying to reapply the config, the DB over wrote the changes and i do see an extra , in the use field. I even tried removing both generic-contact and xi-generic-contact, then apply, config verification fails.

Here is the one that has the proper email address in it

###############################################################################
#
# Contact configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2012-03-09 11:53:12
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define contact {
contact_name IT Support
alias XXXXXX IT Support
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period workhours
service_notification_period workhours
host_notification_options d
service_notification_options c
host_notification_commands notify-host-by-email
service_notification_commands notify-service-by-email
can_submit_commands 1
email [email protected]
host_notifications_enabled 1
retain_status_information 1
service_notifications_enabled 1
use ,generic-contact
}

define contact {
contact_name nagiosadmin
alias Nagios Administrator
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period nagiosadmin_notification_times
service_notification_period nagiosadmin_notification_times
host_notification_options d,u,r,f,s
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handler
email nagios@localhost
host_notifications_enabled 1
service_notifications_enabled 1
use generic-contact,xi_contact_generic
}

###############################################################################
#
# Contact configuration file
#
# END OF FILE
#
###############################################################################
Nagios XI
32 bit VM Image - 2011 R2.2
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Config Verification fails

Post by mguthrie »

Seems like there's some sort of a ghost DB entry for the template relationship. Do you by chance have any contact template entries without a name? Otherwise, for that contact, can you check to see if there's an empty option in the template list that can be removed.

Somewhere there's a DB relationship to a contact or contact template that's creating the extra comma.

If none of these work, just delete, and recreate the contact.
ajwusv
Posts: 28
Joined: Tue Jul 05, 2011 10:13 am

Re: Config Verification fails

Post by ajwusv »

EDIT: I just checked and you were right. There was a template entry that had no information. I have skimmed over that the entire time and never realized that it was an entry that should have been removed. Thanks for all of the help. I will chalk this up to a learning experience on troubleshooting and the dependencies with the system.
Last edited by ajwusv on Fri Mar 09, 2012 2:24 pm, edited 1 time in total.
Nagios XI
32 bit VM Image - 2011 R2.2
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Config Verification fails

Post by scottwilkerson »

If you haven't deleted the contact yet, you could run the following on the server as root

Code: Select all

echo "select ct.* from tbl_contact,tbl_lnkContactToContacttemplate as ct where idMaster=id and contact_name='IT Support' and idSlave<>2"|mysql -pnagiosxi nagiosql
Once I know the content of the return, I could give you the SQL to delete the errand template
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked