Error after Apply configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
perryell
Posts: 52
Joined: Fri May 06, 2011 10:12 am

Error after Apply configuration

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error after Apply configuration

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
perryell
Posts: 52
Joined: Fri May 06, 2011 10:12 am

Re: Error after Apply configuration

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error after Apply configuration

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
perryell
Posts: 52
Joined: Fri May 06, 2011 10:12 am

Re: Error after Apply configuration

Post by perryell »

file attached
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error after Apply configuration

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
perryell
Posts: 52
Joined: Fri May 06, 2011 10:12 am

Re: Error after Apply configuration

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Error after Apply configuration

Post 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
perryell
Posts: 52
Joined: Fri May 06, 2011 10:12 am

Re: Error after Apply configuration

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error after Apply configuration

Post by scottwilkerson »

Glad to see you got it working. Happy New Year to you as well!
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked