Page 1 of 2

Time difference in PHP and system

Posted: Thu Nov 15, 2012 6:45 pm
by relateqld
That is output in Admin-system profile:
Date/Time
PHP Timezone: Australia/Brisbane
PHP Time: Fri, 16 Nov 2012 19:38:05 +1000
System Time: Fri, 16 Nov 2012 09:38:05 +0000


Please note system time is correct. Another thing, I modify the system timezone, but after reboot, it lost config. I am using nagiosxi 2012 R1.2 with centos 6.3

Anyone has same problem with me?

Time difference in PHP and system

Posted: Thu Nov 15, 2012 10:52 pm
by relateqld
We are using nagiosxi 2012 R1.2 with centos 6.3 VM;

Service State: Ok
Duration: 7d 10h 7m 53s
Service Stability: Unchanging (stable)
Last Check: 2012-11-16 03:48:33
Next Check: 2012-11-16 03:58:33

Date/Time
PHP Timezone: Australia/Brisbane
PHP Time: Fri, 16 Nov 2012 13:51:30 +1000
System Time: Fri, 16 Nov 2012 13:51:30 +1000

BTW, I have restart httpd service for several times :cry:

Re: Time difference in PHP and system

Posted: Fri Nov 16, 2012 10:15 am
by slansing
Have you taken a look through this document?

http://assets.nagios.com/downloads/nagi ... m_Time.pdf

Re: Time difference in PHP and system

Posted: Sun Nov 18, 2012 5:42 pm
by relateqld
Yes, but after I installing the system-config-date, I can't open it, below is error message:

[root@nagiosxi ~]# system-config-date
Traceback (most recent call last):
File "/usr/share/system-config-date/system-config-date.py", line 73, in <modul e>
useGuiMode(page)
File "/usr/share/system-config-date/system-config-date.py", line 46, in useGui Mode
import scdMainWindow
File "/usr/share/system-config-date/scdMainWindow.py", line 30, in <module>
import gtk
File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in < module>
_init()
File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _ init
_gtk.init_check()
RuntimeError: could not open display

Re: Time difference in PHP and system

Posted: Mon Nov 19, 2012 12:40 am
by scottwilkerson
Looking at your previous post it looks like the timezones match now.

You may need to restart nagios as we made the time jump 10 hours

Code: Select all

service nagios restart

Re: Time difference in PHP and system

Posted: Mon Nov 19, 2012 1:06 am
by relateqld
restart nagios service, still 10 hours time different in "service check time". But if go to system profile, system time and PHP time are correct, timezone is right as well

Re: Time difference in PHP and system

Posted: Mon Nov 19, 2012 3:18 pm
by scottwilkerson
Actually, if we just updated the time we likely will need to also restart ndo2db

Code: Select all

service ndo2db restart

Re: Time difference in PHP and system

Posted: Mon Nov 19, 2012 6:46 pm
by relateqld
no luck :oops:

Re: Time difference in PHP and system

Posted: Tue Nov 20, 2012 11:13 am
by scottwilkerson
Can you attach your Admin -> System Profile

Re: Time difference in PHP and system

Posted: Tue Nov 20, 2012 5:44 pm
by relateqld
Nagios XI Installation Profile
Download Profile System:
Nagios XI Version : 2012R1.2
nagiosxi.relateqld.local 2.6.32-279.14.1.el6.i686 i686
CentOS release 6.3 (Final)
Gnome is not installed

Apache Information
PHP Version: 5.3.3
Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)
Server Name: nagiosxi
Server Address: 192.168.100.70
Server Port: 80

Date/Time
PHP Timezone: Australia/Brisbane
PHP Time: Wed, 21 Nov 2012 08:42:55 +1000
System Time: Wed, 21 Nov 2012 08:42:55 +1000

Nagios XI Data
nagios (pid 3394) is running...
NPCD running (pid 1720).
ndo2db (pid 2029) is running...
CPU Load 15: 1.05
Total Hosts: 132
Total Services: 595


Ping Test localhost
Running:
/bin/ping -c 3 localhost 2>&1 PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.026 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.027 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.032 ms

--- localhost ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.026/0.028/0.032/0.005 ms