time correction for Nagios

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
nanz28v
Posts: 70
Joined: Tue Dec 11, 2012 2:59 pm

time correction for Nagios

Post by nanz28v »

We have a successful installation of NagiosXI and all is running well except the system time is off by 5 hours. We are in EST and I don't know how to change it since I'm a Linux newbie and we are in evaluation to monitor windows servers only. Thank you in advance.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: time correction for Nagios

Post by abrist »

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.
nanz28v
Posts: 70
Joined: Tue Dec 11, 2012 2:59 pm

Re: time correction for Nagios

Post by nanz28v »

Thank you I was able to change the system time. However this caused an error in IE after I signed in:

NSP: Sorry Dave, I can't let you do that

Please let me know how to resolve this issue, thank you.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: time correction for Nagios

Post by abrist »

Is the date/time/timezone correct on your workstation?
Can you post the time/date/zone information from your profile? (admin --> system profile --> copy the date information and paste it here)
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.
nanz28v
Posts: 70
Joined: Tue Dec 11, 2012 2:59 pm

Re: time correction for Nagios

Post by nanz28v »

Date/Time
PHP Timezone: America/New_York
PHP Time: Mon, 10 Feb 2014 08:03:19 -0500
System Time: Mon, 10 Feb 2014 13:03:19 +0000

It looks like the PHP time and system does not match. I'm a Linux newbie, what command should I run on our Nagios server to fix the issue? Thank you.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: time correction for Nagios

Post by abrist »

It looks like your system is not using the correct timezone from /usr/share/zoneinfo. I did notice a weird problem on certain centos systems. Is /etc/localtime a file or dir?

Code: Select all

file /etc/localtime
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.
nanz28v
Posts: 70
Joined: Tue Dec 11, 2012 2:59 pm

Re: time correction for Nagios

Post by nanz28v »

[root@SM5NAG01 ~]# file /etc/localtime
/etc/localtime: symbolic link to `/usr/share/zoneinfo/America'
[root@SM5NAG01 ~]#
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: time correction for Nagios

Post by sreinhardt »

You will want to remove that symlink and recreate it to the file within America for new york. Should be something like.

Code: Select all

rm /etc/localtime
ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
nanz28v
Posts: 70
Joined: Tue Dec 11, 2012 2:59 pm

Re: time correction for Nagios

Post by nanz28v »

I ran those 2 lines then the date command returned:

[root@SM5NAG01 ~]# rm /etc/localtime
rm: remove symbolic link `/etc/localtime'? y
[root@SM5NAG01 ~]# ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
[root@SM5NAG01 ~]# date
Mon Feb 10 08:55:16 EST 2014
[root@SM5NAG01 ~]#

We are in EST at 1:56pm now. Is there anyway to fix this?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: time correction for Nagios

Post by abrist »

Update the clock with ntp if you have internet connectivity:

Code: Select all

ntpdate pool.ntp.org
date
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