Date/Time Problems
-
ryan_breneman
- Posts: 22
- Joined: Mon Nov 19, 2012 3:50 pm
- Location: Lancaster, PA
Date/Time Problems
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!
Any ideas on how to fix this?
Thanks!
You do not have the required permissions to view the files attached to this post.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Date/Time Problems
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:
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:
Code: Select all
date.timezone = Etc/GMT-13Code: Select all
service httpd restart-
ryan_breneman
- Posts: 22
- Joined: Mon Nov 19, 2012 3:50 pm
- Location: Lancaster, PA
Re: Date/Time Problems
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
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
You do not have the required permissions to view the files attached to this post.
Re: Date/Time Problems
Can you post the output of the following command?
Code: Select all
cat /etc/sysconfig/clockBe sure to check out our Knowledgebase for helpful articles and solutions!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Date/Time Problems
Can you also sort the last checked time descending and post the screenshot again.
Thanks
Thanks
-
ryan_breneman
- Posts: 22
- Joined: Mon Nov 19, 2012 3:50 pm
- Location: Lancaster, PA
Re: Date/Time Problems
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
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
You do not have the required permissions to view the files attached to this post.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Date/Time Problems
Can you post your system profile from Admin -> System Profile
Thanks
Thanks
-
ryan_breneman
- Posts: 22
- Joined: Mon Nov 19, 2012 3:50 pm
- Location: Lancaster, PA
Re: Date/Time Problems
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
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
You do not have the required permissions to view the files attached to this post.
Re: Date/Time Problems
Try the following commands:
Code: Select all
mv /etc/localtime /etc/localtime.bak
ln -s /usr/share/zoneinfo/America/New_York /etc/localtime-
ryan_breneman
- Posts: 22
- Joined: Mon Nov 19, 2012 3:50 pm
- Location: Lancaster, PA
Re: Date/Time Problems
That worked! I ran the commands, rebooted, and now the times are showing correctly!
Thanks so much!
Ryan
Thanks so much!
Ryan