Page 1 of 2

check time is not in sync with the system time

Posted: Tue May 14, 2013 3:37 am
by mroter
Our nagios servers are configured to use Europe/London time ("BST") (used to be UTC in the past).
We've verified that the system profile show the correct system & PHP time.
On the other hand the last/next check time for a service is now one hour behind (probably due to DST).
This is an issue since we need to run some services at a specific London local time. We can modify the time period -1h but then we'll have to modify it each time the DST changes.
Please advise why the check time is not in sync with the system time.

Re: check time is not in sync with the system time

Posted: Tue May 14, 2013 10:09 am
by lmiltchev
What is the output of the following command?

Code: Select all

cat /etc/sysconfig/clock

Re: check time is not in sync with the system time

Posted: Tue May 14, 2013 10:35 am
by mroter
Zone = "UTC"
so what do we do next?

Re: check time is not in sync with the system time

Posted: Tue May 14, 2013 10:38 am
by abrist
What did you set as your "localtime" and your php time?

Re: check time is not in sync with the system time

Posted: Tue May 14, 2013 10:46 am
by mroter
All I changed in the php.ini is the date.timezone
Can you tell me what else I need to change?

Re: check time is not in sync with the system time

Posted: Tue May 14, 2013 11:11 am
by abrist
You will need to set the system time zone: /etc/localtime

Code: Select all

cp /usr/share/zoneinfo/Europe/London /etc/localtime
If you have access to the internet on your XI system, you should consider using the ntp client as well.

Re: check time is not in sync with the system time

Posted: Tue May 14, 2013 11:24 am
by mroter
I did that! This is why the system date is ok.
What I need to change on the php.ini?

Re: check time is not in sync with the system time

Posted: Tue May 14, 2013 12:00 pm
by slansing
If the system is showing the correct PHP time to you then you must have it already set correctly, the line which would be changed would be:

Code: Select all

date.timezone
In:

Code: Select all

/etc/php.ini
What timezone did you choose for the php.ini file? Is it a timezone which properly uses DST?

Re: check time is not in sync with the system time

Posted: Tue May 14, 2013 12:57 pm
by mroter
/etc/localtime is set to Europe/London
In the php.ini date.timezone is the same.
Both system time and php time show the correct BST time.
The problem is with Nagious last & next check time that is 1 hour behind (still utc)
Please look back on this thread, somehow the sysconfig show zone=utc

Re: check time is not in sync with the system time

Posted: Tue May 14, 2013 1:10 pm
by abrist
Is the bios clock correct?

Code: Select all

hwclock --show
Is ntp an option?