In this post, I would like to explain how we configure the NTP (network time protocol) server on HP-UX operating system server. In my recent post you can found the NTP configuration on Solaris and AIX platform.
As you know NTP ( Network time Protocol) is one of the oldest internet protocol still in use and it allows the synchronization of computer clocks distributing UTC (Coordinated Universal Time) over the network. It is basaiclly used for time synchronization on Unix servers.
Step by Step Configuration of NTP Server on HP-UX:
1. In the first step we will check the configuration files of "xntpd" daemon. By default the configuration file for this daemon is "/etc/rc.config.d/netdaemons".
# vi /etc/rc.config.d/netdaemons
######################################
# xntp configuration. See xntpd(1m) #
######################################
#
# Time synchronization daemon
#
# NTPDATE_SERVER: name of trusted timeserver to synchronize with at boot
# (default is rootserver for diskess clients)
# XNTPD: Set to 1 to start xntpd (0 to not run xntpd)
# XNTPD_ARGS: command line arguments for xntpd
#
# Also, see the /etc/ntp.conf and /etc/ntp.keys file for additional
# configuration.
#
export NTPDATE_SERVER=
export XNTPD=0
export XNTPD_ARGS=
This is default configuration entry of this file so for xntpd daemon we need to change the variable which is defined.
export NTPDATE_SERVER='ntp.in.pool.org'
export XNTPD=1
export XNTPD_ARGS=
Note: You must change the NTPDATE server name.
2. For ntp config please set the correct timezone is setup in /etc/TIMEZONE file.
hpx:/> cat /etc/TIMEZONE
TZ=IST-5:30
export TZ
You can edit the file in vi editor and change the time zone as per your location.
3. Now, we need to make some changes in NTP configuration files.
hpx29:/> cat /etc/ntp.conf
#Configuration NTP des serveurs
server ntp.in.org.com
server ntpin.in.org.com
You need to replace ntp server name accordingly. In my post I will use dummy server name.
4. After setting the NTP server name we need to restart the NTP service on HP-UX operating system and verify the ntp configuration.
hpx:/> /sbin/init.d/xntpd restart
hpx:/> ntpq -p
If it is showing you correct ntp server information now. You can match these information with the NTP server name which we use in above step.