Hosts/services stuck "Not applied"

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Hosts/services stuck "Not applied"

Post by lmiltchev »

Go to Admin->System Profile->Show Profile and post a screenshot of the page.

Also run the following commands and show the output:

Code: Select all

uname -a
cat /etc/*release
date
file /etc/localtime
cat /etc/sysconfig/clock
grep timezone /etc/php.ini
echo 'select now();'|mysql -t -u root -pnagiosxi
Is MySQL local or offloaded to a remote server? Are you using LiveStatus or Mod Gearman?
Be sure to check out our Knowledgebase for helpful articles and solutions!
daq
Posts: 19
Joined: Thu Mar 17, 2011 5:33 pm

Re: Hosts/services stuck "Not applied"

Post by daq »

ssax wrote:What version of XI are you using? You can grab it from the bottom left hand side of the web interface. Maybe there's a known bug, I've seen this in older versions.

The likely issue is that the DB timestamp for last_modified date/time is either not being updated or is wrong.

What is the output of this:
- Note: Change CONFIGNAME to a config name of the services that are experiencing the issue

Code: Select all

echo "SELECT DATE_FORMAT(last_modified, '%Y-%m-%d %H:%i:%s'), service_description FROM tbl_service WHERE config_name = 'CONFIGNAME' ORDER BY last_modified DESC LIMIT 1;" | mysql -pnagiosxi nagiosql
We're using the latest 5.2.3
We don't have any services that show up as "Not applied" currently.
But here's the select result for a host that shows "Not applied:"

Code: Select all

SELECT DATE_FORMAT(last_modified, '%Y-%m-%d %H:%i:%s'), host_name FROM tbl_host WHERE host_name = 'host-name' ORDER BY last_modified DESC LIMIT 1;
+-------------------------------------------------+--------------+
| DATE_FORMAT(last_modified, '%Y-%m-%d %H:%i:%s') | host_name    |
+-------------------------------------------------+--------------+
| 2016-01-15 00:42:08                             | host-name |
+-------------------------------------------------+--------------+
1 row in set (0.00 sec)
daq
Posts: 19
Joined: Thu Mar 17, 2011 5:33 pm

Re: Hosts/services stuck "Not applied"

Post by daq »

lmiltchev wrote:Go to Admin->System Profile->Show Profile and post a screenshot of the page.

Also run the following commands and show the output:

Code: Select all

uname -a
cat /etc/*release
date
file /etc/localtime
cat /etc/sysconfig/clock
grep timezone /etc/php.ini
echo 'select now();'|mysql -t -u root -pnagiosxi
Is MySQL local or offloaded to a remote server? Are you using LiveStatus or Mod Gearman?
I'm a little paranoid about posting profile screenshots, but relevant section is below:

Code: Select all

Date/Time
PHP Timezone: America/Los_Angeles
PHP Time: Thu, 14 Jan 2016 17:11:03 -0800
System Time: Fri, 15 Jan 2016 01:11:03 +0000
Command output in order:

Code: Select all

CentOS release 6.7 (Final)

Code: Select all

Fri Jan 15 01:19:15 UTC 2016

Code: Select all

ZONE="America/Los_Angeles"

Code: Select all

date.timezone = America/Los_Angeles

Code: Select all

select now();
+---------------------+
| now()               |
+---------------------+
| 2016-01-15 01:10:09 |
+---------------------+
1 row in set (0.00 sec)
MySQL is local. Not using either one of those mods.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Hosts/services stuck "Not applied"

Post by lmiltchev »

There is a mismatch between your PHP & System time...
PHP Time: Thu, 14 Jan 2016 17:11:03 -0800
System Time: Fri, 15 Jan 2016 01:11:03 +0000
In order to fix this issue, please follow the steps outlined in our "Nagios XI – Changing The System Time" document:

https://assets.nagios.com/downloads/nag ... m_Time.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
daq
Posts: 19
Joined: Thu Mar 17, 2011 5:33 pm

Re: Hosts/services stuck "Not applied"

Post by daq »

lmiltchev wrote:There is a mismatch between your PHP & System time...
PHP Time: Thu, 14 Jan 2016 17:11:03 -0800
System Time: Fri, 15 Jan 2016 01:11:03 +0000
In order to fix this issue, please follow the steps outlined in our "Nagios XI – Changing The System Time" document:

https://assets.nagios.com/downloads/nag ... m_Time.pdf
Well, that's by design. We keep all our servers in UTC, but services that interact with users are set to our local timezone (PST.)

What's the correct way to do this with Nagios?

Thanks.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Hosts/services stuck "Not applied"

Post by rkennedy »

As Nagios uses processes on a front end, and system services on the backend - this causes your timing to be off and could be why the configuration isn't applying as they like to stay in sync.

I believe this is related to those two times mismatching, can you adjust your system time to PST or visa-versa to test?
Former Nagios Employee
daq
Posts: 19
Joined: Thu Mar 17, 2011 5:33 pm

Re: Hosts/services stuck "Not applied"

Post by daq »

rkennedy wrote:As Nagios uses processes on a front end, and system services on the backend - this causes your timing to be off and could be why the configuration isn't applying as they like to stay in sync.

I believe this is related to those two times mismatching, can you adjust your system time to PST or visa-versa to test?
That worked, but now all times in the web interface are in UTC. Is there no way to keep the server time in UTC and change the web interface to local time (PST?)
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Hosts/services stuck "Not applied"

Post by rkennedy »

At the time, there isn't. On the bright side, I have filed a feature request for this. ID 7509.

As the FR has been filed, and your original issue resolved - do you mind if I close this thread out?
Former Nagios Employee
daq
Posts: 19
Joined: Thu Mar 17, 2011 5:33 pm

Re: Hosts/services stuck "Not applied"

Post by daq »

rkennedy wrote:At the time, there isn't. On the bright side, I have filed a feature request for this. ID 7509.

As the FR has been filed, and your original issue resolved - do you mind if I close this thread out?
No I don't. Please close the thread. Thanks for your help!
Unless it is internal, could you post the link to the feature request?
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Hosts/services stuck "Not applied"

Post by bwallace »

Yes, it is internal - We'll lock this thread now and feel free to open another should you require assistance with anything else.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked