check time is not in sync with the system time

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

check time is not in sync with the system time

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post by lmiltchev »

What is the output of the following command?

Code: Select all

cat /etc/sysconfig/clock
Be sure to check out our Knowledgebase for helpful articles and solutions!
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

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

Post by mroter »

Zone = "UTC"
so what do we do next?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

What did you set as your "localtime" and your php time?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

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

Post by mroter »

All I changed in the php.ini is the date.timezone
Can you tell me what else I need to change?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

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

Post by mroter »

I did that! This is why the system date is ok.
What I need to change on the php.ini?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post 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?
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

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

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

Is the bios clock correct?

Code: Select all

hwclock --show
Is ntp an option?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked