NagiosXI setting system time

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mdzx111
Posts: 39
Joined: Tue Apr 17, 2012 2:27 pm

NagiosXI setting system time

Post 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...
jglass
Posts: 37
Joined: Thu Jan 26, 2012 2:28 pm

Re: NagiosXI setting system time

Post 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
mdzx111
Posts: 39
Joined: Tue Apr 17, 2012 2:27 pm

Re: NagiosXI setting system time

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

Re: NagiosXI setting system time

Post 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

ls /usr/share/zoneinfo

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

Code: Select all

ls /usr/share/zoneinfo/America
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

Code: Select all

date
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mdzx111
Posts: 39
Joined: Tue Apr 17, 2012 2:27 pm

Re: NagiosXI setting system time

Post by mdzx111 »

That fixed it, thank you very much!
Locked