Unable to apply configuration.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mccollege
Posts: 45
Joined: Fri Jan 14, 2011 10:06 am

Unable to apply configuration.

Post by mccollege »

I attached an image of the error I'm getting when I try to apply the configuration.
I've expanded "Show Config Changes" which looks good, and "Show Errors" which is blank.

Unrelated or not I'm getting the "Database Backend is not Running!"/"ndo2db is not running but the subsystem is locked" as reported by the xi system status, even though they do in fact appear to be running.

I'm running Nagios XI 2014R1.3 currently.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Unable to apply configuration.

Post by tgriep »

The database backend not running is causing the issue and it also looks like the performance grapher is not running. Lets try restarting them and see if that resolves it.
Open a shell as root to the system and run the following and post the output if it fails.

Code: Select all

service ndo2db restart
service npcd restart
Be sure to check out our Knowledgebase for helpful articles and solutions!
mccollege
Posts: 45
Joined: Fri Jan 14, 2011 10:06 am

Re: Unable to apply configuration.

Post by mccollege »

I was looking through some older threads and saw those steps mentioned, but I did try it again for good measure.
The services stopped/restarted just fine, but not seems to have changed. I waited about 30min before posting this reply.

Oh, I saw in another thread that the profile might be useful, attaching it here.

While I was looking at the profile I noticed that it says:
nagios is not running ( it is running )
NPCD not running ( it is running )
ndo2db is not running but susbsystem is locked ( it is running )
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to apply configuration.

Post by lmiltchev »

Is mysqld running?

Code: Select all

service mysqld status
I saw the following error in the apache error log:
[Thu Aug 27 09:26:44 2015] [error] [client 127.0.0.1] PHP Warning: mysql_pconnect() [<a href='function.mysql-pconnect'>function.mysql-pconnect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
Try:

Code: Select all

service mysqld stop
killall mysqld
rm -f /var/lib/mysql/mysql.sock
service mysqld start
Check to see if mysqld started:

Code: Select all

service mysqld status
Stop/start nagios & ndo2db:

Code: Select all

service nagios stop
service ndo2db stop
service ndo2db start
service nagios start
Also, I noticed that in your profile, the php & system time is out of sync. This can create issues on its own. Please, fix the issue by following the document below:

https://assets.nagios.com/downloads/nag ... m_Time.pdf

Let me know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
mccollege
Posts: 45
Joined: Fri Jan 14, 2011 10:06 am

Re: Unable to apply configuration.

Post by mccollege »

mysqld is running, should I do those steps you listed anyway?

I did update the php date.timezone, so those should be the same now.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to apply configuration.

Post by lmiltchev »

mysqld is running, should I do those steps you listed anyway?
Try restarting mysqld first and checking again to see if it is still running:

Code: Select all

service mysqld restart
service mysqld status
Next, check for errors/corrupted tables in the mysqld.log:

Code: Select all

tail -50 /var/log/mysqld.log
Note: The only line I saw in the mysqld.log (from your profile) was:
140702 16:22:02 mysqld ended
Be sure to check out our Knowledgebase for helpful articles and solutions!
mccollege
Posts: 45
Joined: Fri Jan 14, 2011 10:06 am

Re: Unable to apply configuration.

Post by mccollege »

Ok, I restarted the service, it's running.

The mysqld.log still only contains that single entry.
Yesterday I had ran the /usr/local/nagiosxi/scripts/repairmysql.sh to see if there were any corrupted tables, but it didn't need to fix anything.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Unable to apply configuration.

Post by ssax »

From the profile you sent it says this:

Code: Select all

nagios is not running
NPCD not running.
ndo2db is not running but subsystem locked
You've already restarted them but what is the output of this:

Code: Select all

service nagios status
service npcd status
service ndo2db status
service mysqld status
service postgresql status
Once you've done that, post the output but send us another profile so that we can get the latest logs from it.
mccollege
Posts: 45
Joined: Fri Jan 14, 2011 10:06 am

Re: Unable to apply configuration.

Post by mccollege »

Status outputs:

./nagios status
nagios (pid 10507) is running...
./npcd status
NPCD running (pid 27720).
./ndo2db status
ndo2db (pid 27637) is running...
./mysqld status
mysqld (pid 12810) is running...
./postgresql status
postmaster (pid 20906 20903 20896 20875 20873 9310 8576 5701 5686 5667 5646 5588 5517 5514 5468 3758 3757 3756 3754 3752) is running...


Attaching profile.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Unable to apply configuration.

Post by ssax »

Looks like there are a ton of postgresql processes, run these commands and then try to apply config again, then attach the full output of the tail command after the apply config is completed:

Code: Select all

service postgresql stop
killall -9 postgresql
service postgresql start
tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Locked