Set / Sync NTP / HWClock on Enterprise Linux (RH/OEL)

Another one of my public notes,


#First Configure your ntp servers for the ntp daemon.
vim /etc/ntp.conf

#Chose the options that are going to work best in your case
#We usualy remove the local clock entry and add two new ntp servers
#Add your local / remote ntp server like this.
#server [server address, either hostname or ip] 
server 10.0.0.2 #or
server hostname.domain.ext
#save the settings.

#next check if the ntp daemon is started during system startup for all levels
#that enable networking (235)
chkconfig --list ntpd
ntpd            0:off   1:off   <strong>2:on    3:on</strong>    4:off    <strong>5:on</strong>    6:off

#If ness. add the ntpd daemon to the required levels using;
chkconfig --level 235 ntpd on

#Next sync the system clock with the ntp daemon. BE CAREFULL BEFORE APPYING!
#If the NTP servers time is in the PAST, this step might cause problems when forced
#Readup on ntp how to solve this situation. (yes there is a way­čśë  )
ntpdate 10.0.0.2 #You own addres naturally

#Next enable the ntp daemon to take over the sync task.
service ntpd start #or
/etc/init.d/ntpd start

#To wrap it all up, its nice to sync the hardware clock as well using this step.
hwclock --systohc   (read 'System to Hardwareclock')

#in case you need to manually set the timezone correctly
#You might create the correct link from the 
#usr/share/zoneinfo/?/? to the /etc/localtime Like this
ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime

#Hope this helps you as much as it helped me in the past
#Check to see if the NTPd is working can be done
#using the following command
ntpq
ntpq>peers

About Chris Gralike

Momenteel ben ik manager van de afdeling business continuity bij de zakelijke IT dienstverlener AMIS Services BV. Sinds 2003 ben ik actief in de ICT branche. Tussen 2003 en nu heb ik verschillende rollen vervuld. In de rollen: systeem- en netwerkbeheer, system engineer, servicemanager en nu practice manager ben ik in contact gekomen met uiteenlopende technologie├źn, methodologie├źn, idee├źn, oplossingen en innovaties. Een rijke ervaring waarmee ik de klanten van Conclusion en AMIS elke dag probeer te ondersteunen. Mijn credo: 'Altijd opzoek een win-win tussen business en technologie.'

Posted on November 4, 2009, in centreon, Linux, Linux Commands, Network Monitoring, VMWare and tagged , , , , , , , , , . Bookmark the permalink. 1 Comment.

  1. Worked like a charm under Oracle Linux. Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: