Page 3 of 3

Re: Config Error after rename

Posted: Fri Jul 17, 2015 11:35 am
by notverynick
Ok cool thanks.

I've run the update, it;' failed on the config again , not the update itself by the looks of it but loading the config.

Full backup / upgrade output attached.

So at this point, am I right in thinking the cleanest way out of this is to delete the offending host and re-create?

Re: Config Error after rename

Posted: Fri Jul 17, 2015 11:58 am
by tgriep
You could either delete it of verify that the host is setup correctly for that service.
You can run this to verify your config files are good.

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Re: Config Error after rename

Posted: Fri Jul 17, 2015 1:50 pm
by notverynick
Ok thanks

This is the output from the UI after a failed 'apply config' :

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Could not find any host matching 'Ricoh Large BS3' (config file '/usr/local/nagios/etc/services/Printer Status.cfg', starting on line 14)
Error: Failed to expand host list '15GSRicoh1' for service 'Printer Status' (/usr/local/nagios/etc/services/Printer Status.cfg:14)
Error processing object config files!


***> 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.




And then this is the verify output:

[root@localhost ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for service 'Ping' on host 'mam-regent.eu.mcsaatchi.pri' (config file '/usr/local/nagios/etc/services/mam-regent.eu.mcsaatchi.pri.cfg', starting on line 14)
Warning: Duplicate definition found for service 'Drive C: Disk Usage' on host 'ukam01.mcsaatchi.pri' (config file '/usr/local/nagios/etc/services/Server Disk Space C.cfg', starting on line 14)
Warning: Duplicate definition found for service 'CPU Usage' on host 'ukam01.mcsaatchi.pri' (config file '/usr/local/nagios/etc/services/Server CPU Usage.cfg', starting on line 14)
Warning: Duplicate definition found for service 'Memory Usage' on host 'ukam01.mcsaatchi.pri' (config file '/usr/local/nagios/etc/services/Server Memory Usage.cfg', starting on line 14)
Warning: Duplicate definition found for service 'Ping' on host 'ukam01.mcsaatchi.pri' (config file '/usr/local/nagios/etc/services/Server Ping.cfg', starting on line 14)
Warning: Duplicate definition found for service 'Ping' on host 'mam-soho.eu.mcsaatchi.pri' (config file '/usr/local/nagios/etc/services/Apple Mac Ping.cfg', starting on line 14)
Warning: Duplicate definition found for service 'Ping' on host 'mam-carnaby.eu.mcsaatchi.pri' (config file '/usr/local/nagios/etc/services/Apple Mac Ping.cfg', starting on line 14)
Warning: Duplicate definition found for service 'Ping' on host 'mam-piccadilly.eu.mcsaatchi.pri' (config file '/usr/local/nagios/etc/services/Apple Mac Ping.cfg', starting on line 14)
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 1058 services.
Warning: Host '15GSRicoh1' has no default contacts or contactgroups defined!
Warning: Host '15GSRicoh2' has no default contacts or contactgroups defined!
Warning: Host '15GSRicoh3' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh 1GS' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh 2BS' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh 2GS' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh 3GS' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh 4GS' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh 5GS' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh 6GS' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh GF' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh Large 15GS' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh Large BS3' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh Large BS3 Fiery' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh Large GS1' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh Large GS1 Fiery' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh Large GS5' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh Large GS5 Fiery' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh No2 GS' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh Partners' has no default contacts or contactgroups defined!
Warning: Host 'Ricoh World Services' has no default contacts or contactgroups defined!
Warning: Host 'RicohNo30GPS' has no default contacts or contactgroups defined!
Checked 235 hosts.
Checked 22 host groups.
Checked 0 service groups.
Checked 18 contacts.
Checked 2 contact groups.
Checked 146 commands.
Checked 27 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 235 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 27 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 22
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
[root@localhost ~]#

Re: Config Error after rename

Posted: Fri Jul 17, 2015 1:57 pm
by ssax
Please run this command:

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Then try to run an apply configuration from the web interface and post the full output, I want to see if it gives us any further details.

Re: Config Error after rename

Posted: Fri Jul 17, 2015 2:35 pm
by notverynick
Output attached.

Re: Config Error after rename

Posted: Sun Jul 19, 2015 8:48 pm
by Box293
This is where it is failing:

Error: Failed to expand host list '15GSRicoh1' for service 'Printer Status' (/usr/local/nagios/etc/services/Printer Status.cfg:14)

Go Into CCM
Find the "Printer Status" service
Disable it
Tools > Write Config Files
Click the Delete button
It will say "Successfully deleted all Host / Service Config Files"
Click the Write Button
It will show an output of all the files it creates
Click the Verify button
The output should end with "Total Errors: 0"

Do you get 0 errors?

If you don't please go and resolve the highlighted problem and then perform the steps above again (quickest way is to disable the service it's complaining about).

If you don't have any errors what happens when you Apply Config?
Quick Tools > Apply Configuration
Click the Apply Configuration button

Re: Config Error after rename

Posted: Mon Jul 20, 2015 10:18 am
by notverynick
Ok so a colleague picked this up and had come across the problem before.

He went into the service config screen and checked the attached hosts, which I had already done, however I cancelled out and he hit apply as he had found this necessary before in a similar situation. Essentially this rewrites the file I guess, or lists it for re-write.

That and he removed the renamed host from it's group, again hit apply and then added it back in.

This removed the ghost entry and the config is now clean and applied.

I guess the situation arose due to the way we attach a service to multiple hosts, not directly but through groups. If you want me to provide config snapshots etc so you can test and try to re-prodcue the bug in order to try and remove it then I'm more than happy to provide those.

Otherwise thanks and case closed :)

Nick