Different Time Displayed In GUI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Ben.Patrick
Posts: 10
Joined: Thu Mar 10, 2011 5:26 am

Different Time Displayed In GUI

Post by Ben.Patrick »

Me again... :)

Probably something really simple, but a little quirky.

I have updated the timezone in the shell so that it uses the GMT timezone. When I use the 'date' command, the correct time is shown.
[root@localhost /]# date
Wed Mar 16 16:25:50 GMT 2011
In the Admin secion, underneath the Administrative Tasks Box it shows this message
Last Updated: 2011-03-16 16:23:22
However, when I look in the Service Details to do Schedule an Immediate Check it displays the time in what I assume is Central Time
Last Check: 2011-03-16 11:20:59
Next Check: 2011-03-16 11:25:59
How do I get it so that the correct time is shown for all the scheduled checks?

Thanks

Ben
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: Different Time Displayed In GUI

Post by rdedon »

Most likely you just need to restart Apache:

Code: Select all

 service httpd restart
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Different Time Displayed In GUI

Post by tonyyarusso »

It could also be that you need to set the PHP timezone separately from the system timezone.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
User avatar
Mitchell
Posts: 130
Joined: Thu Jan 05, 2012 2:33 am

Re: Different Time Displayed In GUI

Post by Mitchell »

I am having the same trouble. I am using XI 2011.R9.
the GUI and system time are same but service Last Check time is showing in different time zone.


[root@PCPMNAG02 ~]# date
Thu Jan 26 17:11:42 PST 2012

PHP GUI
Last Updated: 2012-01-26 17:13:08

Service Detail
Last Check: 2012-01-27 01:15:54

it is clear that the time shown in service check is showing in GMT. how can make to show time in PST?

Thanks for your help in advance.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Different Time Displayed In GUI

Post by lmiltchev »

See what is your time zone setting in your pnp.ini file:

Code: Select all

# cat /etc/php.ini | grep date.timezone
Put your proper time zone in the php.ini file, for example:

Code: Select all

date.timezone = America/Chicago
Then run:

Code: Select all

# service httpd restart
For more info, check this out:

http://php.net/manual/en/timezones.php
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Mitchell
Posts: 130
Joined: Thu Jan 05, 2012 2:33 am

Re: Different Time Displayed In GUI

Post by Mitchell »

Thanks for your response. Here is the timezone I used for PDT from official page and have done several httpd restart (even whole server restart)

[root@pnagios02lxv libexec]# cat /etc/php.ini | grep date.timezone
; http://www.php.net/manual/en/datetime.c ... e.timezone
;date.timezone = Europe/London
date.timezone = America/Los_Angeles

After changing the setting here, I was able to see the difference in update part of GUI but not 'LastCheck'. I am not sure where else do I need to make change.

Thanks in advance for your help.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Different Time Displayed In GUI

Post by lmiltchev »

Some customers reported success by copying the sample timezone to /etc/localtime. There are some samples in /usr/share/zoneinfo/. Try:

Code: Select all

# cp /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
# service httpd restart
Try again restarting the server.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Mitchell
Posts: 130
Joined: Thu Jan 05, 2012 2:33 am

Re: Different Time Displayed In GUI

Post by Mitchell »

lmiltchev wrote:Some customers reported success by copying the sample timezone to /etc/localtime. There are some samples in /usr/share/zoneinfo/. Try:

Code: Select all

# cp /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
# service httpd restart
Try again restarting the server.
Great. Thank you. This did the job. :D
Really appreciate your quick help on this.
Locked