Time is off by exactly 6 hours

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
altsysrq
Posts: 17
Joined: Thu Feb 26, 2015 12:35 pm

Time is off by exactly 6 hours

Post by altsysrq »

Timezone that the server is supposed to be in is US Central. But Nagios is reporting everything 6 hours ahead. Here are my settings:

The following is correct (currently it is 2:31PM CST):
[root@nagios ~]# date
Tue Nov 21 14:31:46 CST 2017


[root@nagios ~]# ll /etc/localtime
lrwxrwxrwx 1 root root 30 Sep 20 09:42 /etc/localtime -> /usr/share/zoneinfo/US/Central


[root@nagios ~]# cat /etc/php.ini | grep date.time
; http://php.net/date.timezone
date.timezone = Central


Timezone in System Settings is, "Central Time."

The issue is:
* My "Service Status Detail" is always off by 6 hours. When a service should be down for 10 minutes, it says that the service has been down for "6h 10m 0s".
* "System Status" reports that it was last updated at 2017-11-21 20:32:51, when it should be 2017-11-21 14:32:51.

Is there another location for time settings that we are missing? Any other ideas?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Time is off by exactly 6 hours

Post by lmiltchev »

Try changing this:

Code: Select all

date.timezone = Central
to this:

Code: Select all

date.timezone = US/Central
in the php.ini file, and restart apache:

Code: Select all

service httpd restart
http://php.net/manual/en/timezones.others.php

If this is an option, reboot the server as well.

Are you using local or offloaded mysql db? What's the mysql time?

Code: Select all

echo 'select now();' | mysql -t -uroot -pnagiosxi mysql
Be sure to check out our Knowledgebase for helpful articles and solutions!
altsysrq
Posts: 17
Joined: Thu Feb 26, 2015 12:35 pm

Re: Time is off by exactly 6 hours

Post by altsysrq »

Changing php.ini to US/Central fixed it actually. Thank you!

Time on mysql was correct:
+---------------------+
| now() |
+---------------------+
| 2017-11-21 15:15:56 |
+---------------------+
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Time is off by exactly 6 hours

Post by lmiltchev »

I am glad I could help! :)

I am locking this topic. If you have any more questions/issues, please start a new thread. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked