Page 1 of 2
Date/Time Problems
Posted: Wed Nov 28, 2012 8:34 am
by ryan_breneman
I'm having some issues with time being off on my nagios server. If I ssh into the nagios server and run "date" at the prompt I get the following Wed Nov 28 08:18:10 EST 2012, which is correct. However the time is off by 1 hour when I look at last check or last statechange time stamps. I've attached a screenshot of the operations screen and if you look at the bottom right, the current time is 08:24, however all of the last check times are 1 hour behind. It's not just the operations screen that shows these time problems, it can be anywhere in the system including notification emails.
Any ideas on how to fix this?
Thanks!
Re: Date/Time Problems
Posted: Wed Nov 28, 2012 9:54 am
by scottwilkerson
It is possible that your timezone may not be set correctly in your /etc/php.ini
Newer releases of PHP require this setting for your server to reflect the correct system time and timezone. To change this setting, edit the /etc/php.ini file with the following line:
Change the timezone to match your location. These zones are listed at the following URL.
PHP Timezones After changing the setting, restart your apache server:
Re: Date/Time Problems
Posted: Thu Nov 29, 2012 11:08 am
by ryan_breneman
Scott,
Thanks, I checked that and sure enough it was set to America/Chicago, I needed it to be America/New_York. I restarted Apache & Nagios, plus rebooted the entire server however, it doesn't seem to have fixed the problem I'm having with statechange and last check times. They are still showing up as being one hour behind. Is there somewhere else I can check?
I included another screenshot because it's weird that some areas show the correct time and others show it being 1 hour behind. In the screenshot below the summary charts in the upper right show last updated time being correct, however the last check column in the host status list is one hour behind.
Thanks for your help.
Ryan
Re: Date/Time Problems
Posted: Thu Nov 29, 2012 1:11 pm
by lmiltchev
Can you post the output of the following command?
Re: Date/Time Problems
Posted: Thu Nov 29, 2012 1:12 pm
by scottwilkerson
Can you also sort the last checked time descending and post the screenshot again.
Thanks
Re: Date/Time Problems
Posted: Thu Nov 29, 2012 6:45 pm
by ryan_breneman
The output of cat /etc/sysconfig/clock is ZONE="America/Chicago", so using vi I changed this to read ZONE="America/New_York". I rebooted the box and ran the command again, it appears it stuck because now it's showing America/New_York. Sorry I'm not real familiar with Linux, but how many different places in the operating system do you have to change the time zone info?!
However, Nagios is still not showing the correct times. I've attached a screenshot of the host status screen, with the last checked column sorted in descending order. It was 18:38 when I took the screenshot as you can see by looking at the summary in the upper right, however all the checks are still showing as being one hour behind.
Thanks again for all your help!
Ryan
Re: Date/Time Problems
Posted: Thu Nov 29, 2012 9:02 pm
by scottwilkerson
Can you post your system profile from Admin -> System Profile
Thanks
Re: Date/Time Problems
Posted: Fri Nov 30, 2012 7:16 am
by ryan_breneman
Attached is a txt file download of the system profile.
So I see that system time is showing as one hour behind. Isn't the system time being displayed when I run command "date"? If I run date I get Fri Nov 30 07:09:54 EST 2012
Re: Date/Time Problems
Posted: Fri Nov 30, 2012 10:27 am
by mguthrie
Try the following commands:
Code: Select all
mv /etc/localtime /etc/localtime.bak
ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
Re: Date/Time Problems
Posted: Fri Nov 30, 2012 10:53 am
by ryan_breneman
That worked! I ran the commands, rebooted, and now the times are showing correctly!
Thanks so much!
Ryan