Issues Generating Nagios Config

Support requests, bug reports, questions etc.
Locked
jflanders
beginner
beginner
Posts: 7
Joined: Thu Nov 12, 2009 01:51

Issues Generating Nagios Config

Post by jflanders » Thu Nov 12, 2009 02:04

I just started using Nconf to replace our outdated Monarch as we move to Nagios 3. I'm quite impressed with how intelligent the software is in configuring distributed nagios setup with little input required by the user.

With that said I've hit a bit of a snag when I started creating my own checkcommands and services. After adding them when I click Generate Nagios Config it gives an error on the Collector saying the service check command doesn't exist. This error does not appear on the Monitor check and both show the proper number of hosts/services/checkcommands. I had some luck deleting both the service and the checkcommand and recreating them but when it happend again the solution didn't work.

Here's the output from the Generate Nagios Config:
Generating config:

[INFO] Starting generate_config script
[INFO] Ended generate_config script


Running syntax check:

PI_Active_collector: Total Warnings: 0 Total Errors: 1

Nagios Core 3.2.0
Copyright (c) 2009 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2009
License: GPL
Website: http://www.nagios.org

Reading configuration data...
Read main config file okay...
Processing object config file '/var/www/html/nconf/temp/global/contacts.cfg'...
Processing object config file '/var/www/html/nconf/temp/global/timeperiods.cfg'...
Processing object config file '/var/www/html/nconf/temp/global/misccommands.cfg'...
Processing object config file '/var/www/html/nconf/temp/global/contactgroups.cfg'...
Processing object config file '/var/www/html/nconf/temp/global/checkcommands.cfg'...
Processing object config file '/var/www/html/nconf/temp/PI_Active_collector/hosts.cfg'...
Processing object config file '/var/www/html/nconf/temp/PI_Active_collector/hostgroups.cfg'...
Processing object config file '/var/www/html/nconf/temp/PI_Active_collector/services.cfg'...
Processing object config file '/var/www/html/nconf/temp/PI_Active_collector/servicegroups.cfg'...
Read object config files okay...
Running pre-flight check on configuration data...
Checking services...
Error: Service check command 'check_snmp_storage ' specified in service 'Linux / Usage' for host 'PI-Passive-Nagios' not defined anywhere!
Checked 9 services.
Checking hosts...
Checked 2 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 27 commands.
Checking time periods...
Checked 3 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 1
***> One or more problems was encountered while running the pre-flight check...
Check your configuration file(s) to ensure that they contain valid directives and data defintions. If you are upgrading from a previous version of Nagios, you should be aware that some variables/definitions may have been removed or modified in this version. Make sure to read the HTML documentation regarding the config files, as well as the 'Whats New' section to find out what has changed.

PI_Passive_Nagios: Total Warnings: 0 Total Errors: 0

Nagios Core 3.2.0
Copyright (c) 2009 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2009
License: GPL
Website: http://www.nagios.org

Reading configuration data...
Read main config file okay...
Processing object config file '/var/www/html/nconf/temp/global/contacts.cfg'...
Processing object config file '/var/www/html/nconf/temp/global/timeperiods.cfg'...
Processing object config file '/var/www/html/nconf/temp/global/misccommands.cfg'...
Processing object config file '/var/www/html/nconf/temp/global/contactgroups.cfg'...
Processing object config file '/var/www/html/nconf/temp/global/checkcommands.cfg'...
Processing object config file '/var/www/html/nconf/temp/PI_Passive_Nagios/hosts.cfg'...
Processing object config file '/var/www/html/nconf/temp/PI_Passive_Nagios/hostgroups.cfg'...
Processing object config file '/var/www/html/nconf/temp/PI_Passive_Nagios/extended_host_info.cfg'...
Processing object config file '/var/www/html/nconf/temp/PI_Passive_Nagios/services.cfg'...
Processing object config file '/var/www/html/nconf/temp/PI_Passive_Nagios/servicegroups.cfg'...
Processing object config file '/var/www/html/nconf/temp/PI_Passive_Nagios/extended_service_info.cfg'...
Read object config files okay...
Running pre-flight check on configuration data...
Checking services...
Checked 9 services.
Checking hosts...
Checked 2 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 27 commands.
Checking time periods...
Checked 3 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check

Deployment not possible due to errors in configuration.

User avatar
agargiulo
NConf developer
NConf developer
Posts: 725
Joined: Fri Mar 06, 2009 17:50
Location: Zurich, Switzerland
Contact:

Re: Issues Generating Nagios Config

Post by agargiulo » Thu Nov 12, 2009 17:35

Hi. That's very strange. Maybe you can debug better by generating the files manually.

On the command-line, go to your nconf/ directory and run "bin/generate_config.pl" (do not cd into the "bin" directory!).
Under "nconf/temp/" you should now find the generated config files. If there is indeed a problem with a missing check_command, the command shouldn't be in your "temp/global/checkcommands.cfg" file. Maybe it's a naming mismatch, or maybe a bug in NConf...

After you're done debugging, make sure you remove all files and folders in the "nconf/temp/" directory.

jflanders
beginner
beginner
Posts: 7
Joined: Thu Nov 12, 2009 01:51

Re: Issues Generating Nagios Config

Post by jflanders » Thu Nov 12, 2009 20:45

Thanks I was wondering how I could keep Nconf form immediately deleting the generated temp config.

And there's my problem a blank space ' ' at the end of the checkcommand. I was using copy paste to pull the checkcommand out of our old Monarch and must have copied that blank character. Delete the character out of the checkcommand, recreate the service and everything is fine. Hopefully that'll be my last noob moment for the rest of the week, much appreciated for the help.

Locked