Issue generating config

Support requests, bug reports, questions etc.

Issue generating config

Postby robcaramia » Wed Dec 10, 2014 14:09

Hi i have a serius problem when i try to generate config it fail with this error:
Nagios Core 4.0.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-15-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Could not complete object definition in file '/var/www/nconf/temp/Default_collector/hosts.cfg' on line 1177. Have you named all your objects?
Error processing object config files!


***> The name of the main configuration file looks suspicious...

Make sure you are specifying the name of the MAIN configuration file on
the command line and not the name of another configuration file. The
main configuration file is typically '/usr/local/nagios/etc/nagios.cfg'

***> One or more problems was encountered while processing the config files...

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.


This is the debug info:

expand jQuery debugging
expand Load file "exec_generate_config.php" @ 12:53:16
Autoload: class NConf_DEBUG
Header / ACL / navigation debugging
Initialized module: include/modules/deployment/init.php
call ajax-variable: $debug: yes
call ajax-variable: $ajax: yes
call ajax-file: exec_generate_config.php
call_file: Loading ajax-File "include/ajax/exec_generate_config.php"
Autoload: class NConf_HTML
expand SQL Add to History
expand Query
INSERT INTO `History` (user_str, action, attr_name, attr_value, fk_id_item) VALUES ( 'Administrator', 'general', 'config', 'generating...', NULL)

expand Result: affected rows: 1)
1

expand SQL fetch all monitor and collector servers from DB
expand Query
SELECT fk_id_item AS item_id,attr_value,config_class FROM ConfigValues,ConfigAttrs,ConfigClasses WHERE id_attr=fk_id_attr AND naming_attr='yes' AND id_class=fk_id_class AND (config_class = 'nagios-collector' OR config_class = 'nagios-monitor') ORDER BY attr_value

Result:Resource id #19

expand SQL Add to History
expand Query
INSERT INTO `History` (user_str, action, attr_name, attr_value, fk_id_item) VALUES ( 'Administrator', 'general', 'config', 'generate failed with syntax errors', NULL)

expand Result: affected rows: 1)
1

expand Debugging

Autoload: class NConf_DEBUG
Header / ACL / navigation debugging:
Initialized module: include/modules/deployment/init.php
Autoload: class NConf_PERMISSIONS
Autoload: class NConf_HTML
Item authorization [UNKNOWN(NOT TESTED)]: Checks if you are allowed to access the item
expand SQL Check ConfigAttrs content
expand Query
Result: number of rows:1

expand SQL Check ConfigClasses content
expand SQL Select user Navigation classes
expand Array Create menu user
expand SQL Select admin Navigation classes
expand SQL Select all classes where user has permission
URL ACL status [OK]:
expand URL ACL feedback
ACL: Access granted
Page specific debugging:
Predefined variables:
expand Array COOKIE
expand Array GET
expand Array POST
expand Array SESSION


I navigate in my server and opening the /NagiosConfig_FAILED.tgz.1413986730 and in the hosts.cfg i found 3 "Zombie" hosts looks like this:

define host {
max_check_attempts 3
check_interval 60
retry_interval 10
first_notification_delay 30
notification_interval 60
notification_options d,u,f,r
active_checks_enabled 1
passive_checks_enabled 0
notifications_enabled 1
check_freshness 0
icon_image_alt Cisco IOS
icon_image base/cisco-ios.gif
statusmap_image base/linux40.gd2
check_command check-host-alive
check_period 24x7
notification_period 24x7
contact_groups +admins

In my memory that was 3 cisco switch that i removed from the configuration but it seems to be some residual information in the database.
Digging the database i can't found the associated records.
Any Help???
Thanks
robcaramia
starter
starter
 
Posts: 2
Joined: Fri Oct 31, 2014 13:59

Re: Issue generating config

Postby robcaramia » Wed Dec 10, 2014 18:28

Solved,
digging the DB in the ConfigItems table with the fk_id_class = 1 I have 87 entry but in the Configvalue table with fk_id_class 15 (host_name) I have 84 entry.
I made the diff and removed the line not matching it can work again.
Thanks
robcaramia
starter
starter
 
Posts: 2
Joined: Fri Oct 31, 2014 13:59


Return to Support (NConf 1.3.0)

Who is online

Users browsing this forum: No registered users and 2 guests

cron