Page 2 of 2

Re: Hosts/services stuck "Not applied"

Posted: Tue Jan 12, 2016 10:33 am
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?

Re: Hosts/services stuck "Not applied"

Posted: Thu Jan 14, 2016 8:09 pm
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)

Re: Hosts/services stuck "Not applied"

Posted: Thu Jan 14, 2016 8:20 pm
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.

Re: Hosts/services stuck "Not applied"

Posted: Fri Jan 15, 2016 10:33 am
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

Re: Hosts/services stuck "Not applied"

Posted: Fri Jan 15, 2016 1:31 pm
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.

Re: Hosts/services stuck "Not applied"

Posted: Fri Jan 15, 2016 2:05 pm
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?

Re: Hosts/services stuck "Not applied"

Posted: Fri Jan 15, 2016 7:03 pm
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?)

Re: Hosts/services stuck "Not applied"

Posted: Mon Jan 18, 2016 4:38 pm
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?

Re: Hosts/services stuck "Not applied"

Posted: Tue Jan 19, 2016 1:22 pm
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?

Re: Hosts/services stuck "Not applied"

Posted: Tue Jan 19, 2016 2:02 pm
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.