Page 1 of 1

Error after Apply configuration

Posted: Thu Dec 29, 2011 2:20 pm
by perryell
We have a problem applying changes to the configuration . We are getting
An error occurred while attempting to apply your configuration to Nagios Core.Configurations failed to write to file. Monitoring engine configuration files have been rolled back to their last known good checkpoint.
The snapshot is not showing any error we can trace for today
When I tried tool-write config files- write monitoring data/check config i dont see any error, checking configuration files with -v option return success
I tried a couple of things..restart nagios/nagiosxi, reboot the server and repair the database..no luck
Can you help to troubleshoot?

Re: Error after Apply configuration

Posted: Thu Dec 29, 2011 2:26 pm
by scottwilkerson
Let's try this, log in to your XI server as root and run the following

Code: Select all

/usr/local/nagiosxi/scripts/reset_config_perms
Then this

Code: Select all

cd /usr/local/nagiosxi/scripts
 reconfigure_nagios.sh &> reconfig.txt
Then if you could post the reconfig.txt we'll have a look

Re: Error after Apply configuration

Posted: Thu Dec 29, 2011 2:42 pm
by perryell
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://loca
lhost/nagiosql/index.php --no-check-certificate --post-data 'Submit=Login&tfUser
name=nagiosxi&tfPassword=xxxx' -O nagiosql.loginLOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...Array
(
)
RESETTING PERMS
SETUID ROOT OK
URL: http://localhost/nagiosql/index.php
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://loca
lhost/nagiosql/index.php --no-check-certificate --post-data 'Submit=Login&tfUser
name=nagiosxi&tfPassword=xxxxx' -O nagiosql.loginLOGIN SUCCESSFUL!
URL: http://localhost/nagiosql/admin/verify.php
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/ve
rify.php --no-check-certificate --post-data 'writeMonitoring=Go' -O nagiosql.exp
ort.monitoring
NAGIOSQL WRITE CONFIGS FAILED!\n

Re: Error after Apply configuration

Posted: Thu Dec 29, 2011 2:58 pm
by scottwilkerson
Can we do the following:

Code: Select all

cd /tmp
wget http://assets.nagios.com/downloads/nagiosxi/scripts/NagiosXI-FixPerms.sh
chmod +x NagiosXI-FixPerms.sh
./NagiosXI-FixPerms.sh
Then

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh &> reconfig.txt
If you could attach the whole reconfig.txt file that would be great because the board eats some of what you paste in.

Re: Error after Apply configuration

Posted: Thu Dec 29, 2011 3:13 pm
by perryell
file attached

Re: Error after Apply configuration

Posted: Thu Dec 29, 2011 3:43 pm
by scottwilkerson
Ok, let's go back to the web interface and I would like to to do the following:
Configure -> Core Config Manager -> Tools -> Write Config Files

We are going to click go on each of these from the top down until we get an error, and then report back with any errors.

Re: Error after Apply configuration

Posted: Thu Dec 29, 2011 3:50 pm
by perryell
Writing monitoring data--after two minues replays with a blank page..no error, zero info, page only contains the "nagios Core Config manager" header

writing additional data

Write timeperiods.cfg ...
Configuration file successfully written!
Write commands.cfg ...
Configuration file successfully written!
Write contacts.cfg ...
Configuration file successfully written!
Write contactgroups.cfg ...
Configuration file successfully written!
Write contacttemplates.cfg ...
Configuration file successfully written!
Write servicedependencies.cfg ...
Configuration file successfully written!
Write hostdependencies.cfg ...
Configuration file successfully written!
Write serviceescalations.cfg ...
Configuration file successfully written!
Write hostescalations.cfg ...
Configuration file successfully written!
Write serviceextinfo.cfg ...
Configuration file successfully written!
Write hostextinfo.cfg ...
Configuration file successfully written!

Check configuration files

Total Warnings: 44
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check

Restart nagios
restart without problems

Re: Error after Apply configuration

Posted: Thu Dec 29, 2011 4:54 pm
by mguthrie
I suspect you're hitting either a timeout or memory limit with PHP, I'm guessing it's a larger set of configs that you're applying. Take a look at this wiki and see if it resolves the issue:
http://support.nagios.com/wiki/index.ph ... _Completes

Re: Error after Apply configuration

Posted: Thu Dec 29, 2011 5:08 pm
by perryell
Bingo!
The memory was set to 512M, but the timeout was set to 60, i increased both to 120, the files are written now and configuration applied successfully
Thanks for all your help..happy new year :D

Re: Error after Apply configuration

Posted: Thu Dec 29, 2011 5:24 pm
by scottwilkerson
Glad to see you got it working. Happy New Year to you as well!