Page 2 of 3
Re: How do I change the time in nagiosxi?
Posted: Mon Apr 26, 2010 12:47 pm
by mmestnik
Under Debian this is done like so:
echo "America/Vancouver" > /etc/localtime
I'm not sue when/why this conversion was done, but I don't think it should effect your results.
From /var/lib/dpkg/info/tzdata.config
Code: Select all
# If /etc/localtime is a link, update /etc/timezone
if [ -L /etc/localtime ] ; then
TIMEZONE="$(readlink /etc/localtime)"
TIMEZONE="${TIMEZONE#/usr/share/zoneinfo/}"
if [ -f "/usr/share/zoneinfo/$TIMEZONE" ] ; then
echo ${TIMEZONE} > /etc/timezone
fi
fi
As thread 159 suggest you should also check your hardware clock(be it NVRAM or VMware). You can have this "counter" be set in any time zone, by default RedHat/and every body will expect it to be in GMT. However everybody else, MS Windows, "demands" it to be in localtime. You can change the TZ your hardware clock is in by modifying the RC scripts config file, check the docs for your distribution.
Re: How do I change the time in nagiosxi?
Posted: Wed Jun 09, 2010 6:57 am
by Box293
I've had problems with the date / time reverting to CDT after upgrading to R1.2.
I had originally used the ln -s /usr/share/zoneinfo/Australia/Sydney /etc/localtime method to configure my timezone.
My timezone is Australia/Sydney
date would return the result
Wed Jun 9 06:29:54 CDT 2010
I copied the timezone file over localtime
cp /usr/share/zoneinfo/Australia/Sydney /etc/localtime
date would return the same result
Wed Jun 9 06:30:41 CDT 2010
I copied a different timezone file over localtime
cp /usr/share/zoneinfo/Australia/Perth /etc/localtime
date would return the correct result if I was in Perth
Wed Jun 9 19:30:31 WST 2010
I copied the Sydney file again
cp /usr/share/zoneinfo/Australia/Sydney /etc/localtime
date would return the wrong result again
Wed Jun 9 06:30:41 CDT 2010
I copied a known working Sydney file from another Nagios XI server.
date would return the correct result for Sydney
Wed Jun 9 21:36:05 EST 2010
Unsure why has happened here. I have seen this on two different servers. I tried to reproduce the issue with an upgrade however I was not able to diagnose what caused the issue.
It is my guess that the CDT zonefile is copied over my Australia/Sydney file, somehow by the symbolic link I was using?.
I'm not convinced it is the upgrade to R1.2 that caused the problem.
I've since learnt a lot about date/time with CentOS. If I could make a suggestion, perhaps include the system-config-date utility installed in the VMware image you provide.
Re: How do I change the time in nagiosxi?
Posted: Wed Jun 09, 2010 10:18 am
by mmestnik
That's correct cp or "mv across file-systems" would cause a symlink's target to be replaced. One method to avoid this, and a lot of contention issues, is to place your new file in the same folder(thus on the same file-system) and then mv it into place. It's also simple to check for the existence of a link and read it's value...
Code: Select all
trufil="$(test -h "$fil" && readlink "$fil" || echo "$fil")"
Re: How do I change the time in nagiosxi?
Posted: Thu Dec 02, 2010 8:46 pm
by zsiga09
Took me an hour to figure this out, hopefully it helps someone.
If you link your /etc/localtime to the zoneinfo files in /usr/share/ (like you would do in RedHat or Centos) it won't make any difference. You have to use the files in /usr/share/zoneinfo/right/. ie:
ln -sf /usr/share/zoneinfo/right/Canada/Pacific /etc/localtime
Also check /etc/sysconfig/clock and fix it if needed.
BTW I'm using the NagiosXI VM v2009RC1.3G.
Cheers,
PeterZ
Re: How do I change the time in nagiosxi?
Posted: Thu Dec 02, 2010 11:15 pm
by botakculun
Try this:
ln -s /var/www/etc/localtime /usr/share/zoneinfo/Australia/Sydney
and then restart the httpd process.
It worked for me
Re: How do I change the time in nagiosxi?
Posted: Fri Jan 27, 2012 12:42 pm
by shawn.snavely
The issue I'm having is the timezone if off. So I have installed the system-config-date module and it states that it installed correctly. However, when I try to run the system-config-date command to change the timezone, I end up with this error:
Traceback (most recent call last):
File "/usr/share/system-config-date/system-config-date.py", line 73, in <module>
useGUIMode(page)
File "/usr/share/system-config-date/system-config-date.py", line 46 in useGUIMode
import scdMainWindow
File "/usr/share/system-config-date/scdMainWindow.py", line 30, in <module>
import gtk
File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module>
_init( )
File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init
_gtk.init_check()
RuntimeError: could not open display
Would anyone have any suggestions on how to correct this so that I can make the timezone change? Thank you!
Re: How do I change the time in nagiosxi?
Posted: Fri Jan 27, 2012 1:56 pm
by lmiltchev
Do you have the timezone, setup in your php.ini file? Run this command in terminal and post the output:
Code: Select all
# cat /etc/php.ini | grep date.timezone
Re: How do I change the time in nagiosxi?
Posted: Fri Jan 27, 2012 2:17 pm
by shawn.snavely
I ran the command and the output is:
;
http://www.php.net/manual/en/datetime.c ... e.timezone
date.timezone = Europe/London
Re: How do I change the time in nagiosxi?
Posted: Fri Jan 27, 2012 2:52 pm
by scottwilkerson
What timezone are you in?
Re: How do I change the time in nagiosxi?
Posted: Fri Jan 27, 2012 2:53 pm
by shawn.snavely
Sorry...America - Eastern Std Time (NYC/Philadelphia)