Page 1 of 2

Cannot change system time in Nagios XI

Posted: Thu Oct 06, 2011 9:07 am
by brian.gamble
Running VMWare Player on 64bit version of Windows Server 2008
VMware Image 1.7


Followed instructions outlined in the Nagios XI – Changing The System Time document but cannot access the Timezone Configuration Tool after executing system-config-date command.

Message pops up saying:
Traceback (most recent call last):
followed by 5 file path listings, then
RuntimeError: could not open display

The required package was downloaded and installed without error.

Thanks

Re: Cannot change system time in Nagios XI

Posted: Thu Oct 06, 2011 11:05 am
by lmiltchev
I was not able to recreate your problem. If the "system-config-date" utility doesn't work for you, you can try using the "ntp" instead:

Code: Select all

# yum install ntp
# ntpdate pool.ntp.org
Then, you can add it as a cron job (for example to update system time every day at 1:30 pm):

Code: Select all

# crontab -e

30 13 * * * /usr/sbin/ntpdate pool.ntp.org
Hope this helps!

Re: Cannot change system time in Nagios XI

Posted: Thu Oct 06, 2011 11:33 am
by rseiwert
Ohh, you better get your timezone straight. I was using NTP but the system would boot. Nagios would start. Then the time would jump back an hour and nothing would get checked for an hour. I was using the VM image and setup NTP but never adjusted the timezone.

You just need to copy the sample timezone to /etc/localtime. You can find samples in /usr/share/zoneinfo/
For me it was:
cp /usr/share/zoneinfo/America/New_York /etc/localtime

Re: Cannot change system time in Nagios XI

Posted: Thu Oct 06, 2011 11:56 am
by lmiltchev
I've never had issues with ntp, but I guess it is possible. Did running "cp /usr/share/zoneinfo/America/New_York /etc/localtime" fix your problem? Some customers reported fixing the system time issues only after editing the "date.timezone =" line in their "php.ini" file.

Re: Cannot change system time in Nagios XI

Posted: Thu Oct 06, 2011 12:25 pm
by rseiwert
Before I set the timezone I had an issue everytime I rebooted Nagios all my checks would have their next check an hour in the future. I would assume if you started the nagios service AFTER the ntp updated there would be no issue but that was not happening for me.

Re: Cannot change system time in Nagios XI

Posted: Thu Oct 06, 2011 12:56 pm
by lmiltchev
This makes sense. Thanks for the feedback!

Re: Cannot change system time in Nagios XI

Posted: Thu Oct 06, 2011 1:27 pm
by brian.gamble
Ok, I did as suggested and the time changed on the server but did not when logged into XI. After a reboot, the server fails to come back.

Is it supposed to be this difficult for non-Linux people? Help!

Re: Cannot change system time in Nagios XI

Posted: Thu Oct 06, 2011 1:48 pm
by rseiwert
Several things. What do you mean doesn't come back. Does the VM boot? Do you reach a console? Are you getting the "I'm sorry Dave I cannot do that?

What is the contents of your /etc/sysconfig/clock ?
There is a value UTC which determines if your hardware clock is set to UTC. This will also cause time to jump around.
There is also a timezone setting there.
Also there is a timezone setting in php which needs to be right. (I'm sorry Dave I cannot do that).

Had tons of problems with Nagios till I got those sorted out. I feel your pain not being a linux dude.

Re: Cannot change system time in Nagios XI

Posted: Thu Oct 06, 2011 2:42 pm
by brian.gamble
When the image is loading in VMware Player, it just freezes. I've left if for a while and it is still frozen. I cannot login since it does not load me to the point where I can login.

Re: Cannot change system time in Nagios XI

Posted: Thu Oct 06, 2011 2:45 pm
by rseiwert
Ouch, hopefully you have a snapshot..... Easier than troubleshooting.