Page 1 of 1
NagiosXI setting system time
Posted: Thu Apr 26, 2012 4:18 pm
by mdzx111
Hello,
I'm trying to follow the PDF on updating the XI server time found here.
http://assets.nagios.com/downloads/nagi ... m_Time.pdf
When I try to run the command:
system-config-date I get:
[root@localhost ~]# system-config-date
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
[root@localhost ~]#
So it looks the the GUI isnt working?
Please advise...
Re: NagiosXI setting system time
Posted: Fri Apr 27, 2012 8:42 am
by jglass
I hope that someone posts a solution for the GUI tool because I receive the same (or very similar) error as you, and it's very frustrating.
After searching relentlessly, I found articles describing how to set the date and time -- The frustrating part is that none of them worked.
For the time being, I'm using this as a band-aid: One solution would be just to add "ntpdate time.nist.gov" to /etc/rc.d/rc.local
I believe with the above solution, you also need to ensure that your time zone is set correctly in the /etc/php.ini.
-JG
Re: NagiosXI setting system time
Posted: Fri Apr 27, 2012 8:53 am
by mdzx111
Thank you for your suggestions. I agree. For me and my company EVERY part of this new NagiosXI setup has been one problem after another. I'm hoping I can get an offical answer very soon. We want to use this software, but it's been a real challenge. Even changing the time is a problem!
Help please!
Re: NagiosXI setting system time
Posted: Fri Apr 27, 2012 1:50 pm
by scottwilkerson
Not sure why that utility is bombing out but you can also set the system time by doing the following"
Find the closed match to your location in /usr/share/zoneinfo by doing the following (my example will be for Chicago, America)
Code: Select all
Africa Australia Cuba Etc GMT0 Iceland Japan MST Poland right Universal Zulu
America Brazil EET Europe GMT-0 Indian Kwajalein MST7MDT Portugal ROC US
Antarctica Canada Egypt Factory GMT+0 Iran Libya Navajo posix ROK UTC
Arctic CET Eire GB Greenwich iso3166.tab MET NZ posixrules Singapore WET
Asia Chile EST GB-Eire Hongkong Israel Mexico NZ-CHAT PRC Turkey W-SU
Atlantic CST6CDT EST5EDT GMT HST Jamaica Mideast Pacific PST8PDT UCT zone.tab
I see an America Directory, so I run
From here i can see a file for Chicago which is in my timezone.
Then, make a backup of the existing localtime file. It’s always good practice to make backups of original config files.
Code: Select all
mv /etc/localtime /etc/localtime.bak
Next, create the link:
Code: Select all
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
Make sure to replace “America/Chicago” with the directory (if your zone has one) and filename of the timezone you wish to use.
Now you just need to test your change. Run “date” from the command line, and ensure that the appropriate time, date, and timezone are reported.
Now to set the date, as mentioned ntp works great, lets download it and force the initial update
Code: Select all
yum install ntp -y
service ntpd start
ntpdate pool.ntp.org
ntpdate pool.ntp.org
ntpdate pool.ntp.org
Now Verify your date
Re: NagiosXI setting system time
Posted: Fri Apr 27, 2012 2:11 pm
by mdzx111
That fixed it, thank you very much!