How to best set Centos/Nagios Time?
Posted: Tue Apr 03, 2012 2:57 pm
Hello:
Kindly assist me with setting the system time (as I have become very frustrated trying to get it set by myself!). Every time I restart the server my time is slow by 6 hours. I believe I have found the file that is causing this, but I’m not sure about how to fix it. Ultimately, it would be nice to use the system-config-date utility, although this will not run for me.
First, my /etc/localtime file looks funny, and I believe this is the file that is throwing my time off. I’m assuming this since I see the ‘6’ at the bottom on the text, and since my time always shows 6 hours behind. Also, I’m not sure why or if all the foreign characters should be present. Here’s what the file looks like:
GNU nano 2.0.9 File: /etc/localtime
TZif2^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^E^@^@^@^E^@^@^@^@^@^@^@�^@^@^@^E^@^@^@^T��,����p��^N����p��t^N���GpË��Ò#�pÒa �Óu�^@Ô@��ÕUÕ^@ Í� 5�^@Ø^@��Ù^U�^@Ù���Ú���Û�s�ÜÞ�ݩ�p y�ßrp��^@�¿½iTp�~=��I6p�^^_��W<��G<^@�7^^��'^^^@�^W^@��^G^@^@����$
^@^A���^Bw�^@^Cq^Lp^Da^K�^EP�p^F@��^G0�p^G�'� ^P�p ��^@
��p^K���^Lٰ�
�u�^N���^O��^@^P�t�^Q�t^@^RyV�^SiV^@^TY8�^UI8^@^V9^Z�^W)^Z^@^X"7p^Y^H�^@^Z^B^Yp^Z�^X�^[��p^\�ï¿c�) �*�E�+���,Ó³bp-�w�.�Dp/~Y�0�&p1gv^@2s^Hp3GX^@4R�p5':^@62̳p7^G^\^@8^[��8��^@9�ʳ�:Ƴ�^@;ÛO�I�{^@J�1�K���L�NpM|y�N�0pO\[�P�^RpQ<=�Ru�pS^\^_�TU�pT�^A�V5�pV�^^^@X^^��X�^@^@Y����eG=pe�h�g'^_pg�J�i^G^Api�,�j��pk�I^@l���mv+^@n���oV
^@p���q5�^@ro��s^U�^@tO��t���v8�pv�Ïx^X�px���y�hpz���{ØJp|~u�}�,p~^W�^?�^Np^@^A^@N�������Gp����Ë������Ò#�p����Òa �����Óu�^@����Ô@������Õ�^@^@^@^@^@� Í����� 5�^@����Ø^@������Ù^U�^@����Ù�������Ú�����ï^@^@^@^@^@^A���^@^@^@^@^Bw�^@^@^@^@^@^Cq^Lp^@^@^@^@^Da^K�^@^@^@^@^EP�p^@^@^@^@^F@��^@^@^@^@^G0�p^@^@^@^@^G�'�^@��p^@^@^@^@^K���^@^@^@^@^Lٰ�^@^@^@^@
�u�^@^@^@^@^N���^@^@^@^@^O��^@^@^@^@^@^P�t�^@^@^@^@^Q�t^@^@^@^@^@^RyV�^@^@^@^@^SiV^@^@^@^@^@^TY8�^@^@^@^@^UI8c�^@^@^@^@) �^@^@^@^@*�E�^@^@^@^@+���^@^@^@^@,Ó³bp^@^@^@^@-�w�^@^@^@^@.�Dp^@^@^@^@/~Y�^@^@^@^@0�&p^@^@^@^@1gvO�^@^@^@^@I�{^@^@^@^@^@J�1�^@^@^@^@K���^@^@^@^@L�Np^@^@^@^@M|y�^@^@^@^@N�0p^@^@^@^@O\[�^@^@^@^@P�^Rp^@^@^@^@Q��^@^@^@^@eG=p^@^@^@^@e�h�^@^@^@^@g'^_p^@^@^@^@g�J�^@^@^@^@i^G^Ap^@^@^@^@i�,�^@^@^@^@j��p^@^@^@^@k�I^@^@^@^@^@l^@^@^@^@^@p���^@^@^@^@q5�^@^@^@^@^@ro��^@^@^@^@s^U�^@^@^@^@^@tO��^@^@^@^@t���^@^@^@^@v8�p^@^@^@^@v�Ï^@^@^CST6CDT,M3.2.0,M11.1.0��^@^@^@^$
Should I remove everything from this file and leave it with: Zone=”US/Central”
Regarding system-config-date -- I would love to be able to simply use the GUI utility to set the time, but I receive this error:
[root@opsmon ~]# 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@opsmon ~]#
Any help would be greatly appreciated!! I am forced to run ntpdate time.nist.gov everytime I need to bring down the system.
I'm running Centos 6.2 with Nagios XI 2011R2.1.
Thanks,
Jason
Kindly assist me with setting the system time (as I have become very frustrated trying to get it set by myself!). Every time I restart the server my time is slow by 6 hours. I believe I have found the file that is causing this, but I’m not sure about how to fix it. Ultimately, it would be nice to use the system-config-date utility, although this will not run for me.
First, my /etc/localtime file looks funny, and I believe this is the file that is throwing my time off. I’m assuming this since I see the ‘6’ at the bottom on the text, and since my time always shows 6 hours behind. Also, I’m not sure why or if all the foreign characters should be present. Here’s what the file looks like:
GNU nano 2.0.9 File: /etc/localtime
TZif2^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^E^@^@^@^E^@^@^@^@^@^@^@�^@^@^@^E^@^@^@^T��,����p��^N����p��t^N���GpË��Ò#�pÒa �Óu�^@Ô@��ÕUÕ^@ Í� 5�^@Ø^@��Ù^U�^@Ù���Ú���Û�s�ÜÞ�ݩ�p y�ßrp��^@�¿½iTp�~=��I6p�^^_��W<��G<^@�7^^��'^^^@�^W^@��^G^@^@����$
^@^A���^Bw�^@^Cq^Lp^Da^K�^EP�p^F@��^G0�p^G�'� ^P�p ��^@
��p^K���^Lٰ�
�u�^N���^O��^@^P�t�^Q�t^@^RyV�^SiV^@^TY8�^UI8^@^V9^Z�^W)^Z^@^X"7p^Y^H�^@^Z^B^Yp^Z�^X�^[��p^\�ï¿c�) �*�E�+���,Ó³bp-�w�.�Dp/~Y�0�&p1gv^@2s^Hp3GX^@4R�p5':^@62̳p7^G^\^@8^[��8��^@9�ʳ�:Ƴ�^@;ÛO�I�{^@J�1�K���L�NpM|y�N�0pO\[�P�^RpQ<=�Ru�pS^\^_�TU�pT�^A�V5�pV�^^^@X^^��X�^@^@Y����eG=pe�h�g'^_pg�J�i^G^Api�,�j��pk�I^@l���mv+^@n���oV
^@p���q5�^@ro��s^U�^@tO��t���v8�pv�Ïx^X�px���y�hpz���{ØJp|~u�}�,p~^W�^?�^Np^@^A^@N�������Gp����Ë������Ò#�p����Òa �����Óu�^@����Ô@������Õ�^@^@^@^@^@� Í����� 5�^@����Ø^@������Ù^U�^@����Ù�������Ú�����ï^@^@^@^@^@^A���^@^@^@^@^Bw�^@^@^@^@^@^Cq^Lp^@^@^@^@^Da^K�^@^@^@^@^EP�p^@^@^@^@^F@��^@^@^@^@^G0�p^@^@^@^@^G�'�^@��p^@^@^@^@^K���^@^@^@^@^Lٰ�^@^@^@^@
�u�^@^@^@^@^N���^@^@^@^@^O��^@^@^@^@^@^P�t�^@^@^@^@^Q�t^@^@^@^@^@^RyV�^@^@^@^@^SiV^@^@^@^@^@^TY8�^@^@^@^@^UI8c�^@^@^@^@) �^@^@^@^@*�E�^@^@^@^@+���^@^@^@^@,Ó³bp^@^@^@^@-�w�^@^@^@^@.�Dp^@^@^@^@/~Y�^@^@^@^@0�&p^@^@^@^@1gvO�^@^@^@^@I�{^@^@^@^@^@J�1�^@^@^@^@K���^@^@^@^@L�Np^@^@^@^@M|y�^@^@^@^@N�0p^@^@^@^@O\[�^@^@^@^@P�^Rp^@^@^@^@Q��^@^@^@^@eG=p^@^@^@^@e�h�^@^@^@^@g'^_p^@^@^@^@g�J�^@^@^@^@i^G^Ap^@^@^@^@i�,�^@^@^@^@j��p^@^@^@^@k�I^@^@^@^@^@l^@^@^@^@^@p���^@^@^@^@q5�^@^@^@^@^@ro��^@^@^@^@s^U�^@^@^@^@^@tO��^@^@^@^@t���^@^@^@^@v8�p^@^@^@^@v�Ï^@^@^CST6CDT,M3.2.0,M11.1.0��^@^@^@^$
Should I remove everything from this file and leave it with: Zone=”US/Central”
Regarding system-config-date -- I would love to be able to simply use the GUI utility to set the time, but I receive this error:
[root@opsmon ~]# 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@opsmon ~]#
Any help would be greatly appreciated!! I am forced to run ntpdate time.nist.gov everytime I need to bring down the system.
I'm running Centos 6.2 with Nagios XI 2011R2.1.
Thanks,
Jason