Time difference in PHP and system

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
relateqld
Posts: 41
Joined: Sun Nov 11, 2012 8:15 pm

Time difference in PHP and system

Post 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?
relateqld
Posts: 41
Joined: Sun Nov 11, 2012 8:15 pm

Time difference in PHP and system

Post 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:
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Time difference in PHP and system

Post by slansing »

Have you taken a look through this document?

http://assets.nagios.com/downloads/nagi ... m_Time.pdf
relateqld
Posts: 41
Joined: Sun Nov 11, 2012 8:15 pm

Re: Time difference in PHP and system

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Time difference in PHP and system

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
relateqld
Posts: 41
Joined: Sun Nov 11, 2012 8:15 pm

Re: Time difference in PHP and system

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Time difference in PHP and system

Post by scottwilkerson »

Actually, if we just updated the time we likely will need to also restart ndo2db

Code: Select all

service ndo2db restart
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
relateqld
Posts: 41
Joined: Sun Nov 11, 2012 8:15 pm

Re: Time difference in PHP and system

Post by relateqld »

no luck :oops:
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Time difference in PHP and system

Post by scottwilkerson »

Can you attach your Admin -> System Profile
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
relateqld
Posts: 41
Joined: Sun Nov 11, 2012 8:15 pm

Re: Time difference in PHP and system

Post 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
Locked