Page 1 of 1

misleading apply configuration error

Posted: Thu Jun 28, 2012 9:37 am
by kubben
i removed two hosts and associated services, and applied configuration on our nagios xi install, Nagios XI 2011R2.3 (removed services first, then hosts.)

i get the typical error :

Command submitted for processing...
Waiting for configuration verification..............................................................
Configurations failed to write to file.
An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.

then when checking the specific error, i have:


Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config directory '/usr/local/nagios/etc/static'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/contacts.cfg'...
Warning: Duplicate definition found for contact 'xi_default_contact' (config file '/usr/local/nagios/etc/contacts.cfg', starting on line 922)
Error: Could not add object property in file '/usr/local/nagios/etc/contacts.cfg' on line 923.
Error processing object config files!

The thing is, there is *no* xi_default_contact in the /usr/local/nagios/etc/contacts.cfg at *all*

that contact is only defined in /usr/local/nagios/etc/static/xiobjects.cfg and it is defined once:

[root@nagiosxi etc]# pwd
/usr/local/nagios/etc
[root@nagiosxi etc]# grep xi_default_contact -R *
static/xiobjects.cfg: contact_name xi_default_contact


what is happening here?

currently we are unable to make any changes in nagios XI, and i have no starting point here to begin trouble shooting.

vmware image install, i686, 8cpu 8gig memory, mysql server has been rolled off to another vm CentOS release 6.2 (Final)

Re: misleading apply configuration error

Posted: Thu Jun 28, 2012 9:44 am
by scottwilkerson
This looks like you imported objects that are found in /usr/local/nagios/etc/static/xiobjects.cfg

Try deleting this file and Apply configuration again.

Re: misleading apply configuration error

Posted: Thu Jun 28, 2012 9:49 am
by kubben
i gave that a try, sadly, i get the same error. anything else you can suggest?

Re: misleading apply configuration error

Posted: Thu Jun 28, 2012 10:51 am
by scottwilkerson
Lets delete the file again, then go to
Configure -> CCM -> Tools -> Write Config Files

Click the top 3 items one at a time checking for errors.

If you see errors we need to fix them in the CCM, then repeat the top 3 steps above before continuing to click the 4th Go button

Re: misleading apply configuration error

Posted: Thu Jun 28, 2012 11:45 am
by kubben
does that write the config files from the mysql data base information?

Re: misleading apply configuration error

Posted: Thu Jun 28, 2012 12:00 pm
by kubben
ok, that worked. nagios is again running, and i made a database dump. however, if i "apply configuration" now it fails with the normal error, but when you go to look at the specific error, there is no new entry.

and the config files are half written and broken.

restoring the data base and writing the files again from ccm brings me back to a working state, but i cannot apply changes.

thoughts?

Re: misleading apply configuration error

Posted: Thu Jun 28, 2012 1:33 pm
by scottwilkerson
2 things come to mind. First, lets verify that the hard drive isn't full

Code: Select all

df -h
Once that is out of the way, it is possibly caused by a php timeout or memory limit
http://support.nagios.com/wiki/index.ph ... _Completes

Re: misleading apply configuration error

Posted: Thu Jun 28, 2012 3:01 pm
by mguthrie
Configurations failed to write to file.
This particular message means that the Core Config Manager is not able to write new configuration files to the /usr/local/nagios/etc directory. This is most likely either a permissions issue or a lack of free space left on the drive.

Re: misleading apply configuration error

Posted: Thu Jun 28, 2012 3:17 pm
by kubben
[root@nagiosxi services]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9.5G 4.7G 4.4G 53% /
tmpfs 4.0G 0 4.0G 0% /dev/shm
/dev/sda1 97M 39M 54M 42% /boot


still half available, and i have another disk yet to add to the vg:

[root@nagiosxi services]# pvdisplay

snip
"/dev/sdb" is a new physical volume of "15.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sdb
VG Name
PV Size 15.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID zAk9j4-Cm3h-pJzJ-0d8p-LMgx-ENAC-yed3hD


in /etc/php.ini
memory_limit = 128M
max_execution_time = 60
max_input_time = 60

i have changed these to:
memory_limit = 256M
max_execution_time = 120
max_input_time = 120

as for DNS:
[root@nagiosxi etc]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.22.0.107 nagiosxi.fastenal.com nagiosxi

[root@nagiosxi etc]# hostname
nagiosxi.fastenal.com

[root@nagiosxi etc]# host nagiosxi.fastenal.com
nagiosxi.fastenal.com has address 172.22.0.107

[root@nagiosxi etc]# host 172.22.0.107
107.0.22.172.in-addr.arpa domain name pointer nagiosxi.fastenal.com.

with the php.ini changes:

Applying Configuration

Command submitted for processing...
Waiting for configuration verification....................................................................................
Configuration applied successfully.
Success! Nagios Core was restarted with an updated configuration.

8) thank you. seems we were simply timing out half way through the write and ending up with broken half written files.

Re: misleading apply configuration error

Posted: Thu Jun 28, 2012 3:59 pm
by mguthrie
Good deal, glad it's working again!