Date/Time Problems

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ryan_breneman
Posts: 22
Joined: Mon Nov 19, 2012 3:50 pm
Location: Lancaster, PA

Date/Time Problems

Post 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!
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

Post 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:

Code: Select all

 date.timezone = Etc/GMT-13
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:

Code: Select all

 service httpd restart
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ryan_breneman
Posts: 22
Joined: Mon Nov 19, 2012 3:50 pm
Location: Lancaster, PA

Re: Date/Time Problems

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Date/Time Problems

Post by lmiltchev »

Can you post 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!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Date/Time Problems

Post by scottwilkerson »

Can you also sort the last checked time descending and post the screenshot again.

Thanks
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ryan_breneman
Posts: 22
Joined: Mon Nov 19, 2012 3:50 pm
Location: Lancaster, PA

Re: Date/Time Problems

Post 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
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

Post by scottwilkerson »

Can you post your system profile from Admin -> System Profile

Thanks
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ryan_breneman
Posts: 22
Joined: Mon Nov 19, 2012 3:50 pm
Location: Lancaster, PA

Re: Date/Time Problems

Post 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
You do not have the required permissions to view the files attached to this post.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Date/Time Problems

Post 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
ryan_breneman
Posts: 22
Joined: Mon Nov 19, 2012 3:50 pm
Location: Lancaster, PA

Re: Date/Time Problems

Post by ryan_breneman »

That worked! I ran the commands, rebooted, and now the times are showing correctly!

Thanks so much!
Ryan
Locked