Operating System - HP-UX
1827876 Members
1613 Online
109969 Solutions
New Discussion

How to automate automic clock sync.

 
Debbie Fleith
Regular Advisor

How to automate automic clock sync.

We have several HP 10.20 and 11.0 servers that we need to update/sync the system date/time to the atomic clock every night.

We need a way to automate this in a script and be able to set the clock backwards, if necessary, without having to answer any prompts.
6 REPLIES 6
Rajeev Tyagi
Valued Contributor

Re: How to automate automic clock sync.

NTP (Network time protocol) is the right choice for your problem.
hpuxrox
Respected Contributor

Re: How to automate automic clock sync.

You need to enable NTP (Network Time Protical"

man xntpd

also and look at
/etc/ntp.conf
/etc/rc.config.d/netdaemons
James R. Ferguson
Acclaimed Contributor

Re: How to automate automic clock sync.

Hi Debbie:

You should establish 'ntp' and syncrhonize to an external clock or if that is not possible to one of your own local servers. This is quite simple. The procedure is well described here (in chapter-7 of "Installing and Administering Internet Services"):

http://docs.hp.com/hpux/onlinedocs/B2355-90685/B2355-90685.html

For a good source of external servers, see:

http://www.eecis.udel.edu/~mills/ntp/clock1.htm

The US Naval Observatory ones are very good candidates.

Regards!

...JRF...
MANOJ SRIVASTAVA
Honored Contributor

Re: How to automate automic clock sync.

Hi Debbie

You like to take a look at NTP . It is simple to install and here you can create a group of servers which can be adjusted with a standard time source ( external or internal ) .

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90741/B2355-90741_top.html&con=/hpux/onlinedocs/B2355-90741/00/00/67-con.html&toc=/hpux/onlinedocs/B2355-90741/00/00/67-toc.html&searchterms=ntp&queryid=20020501-134411

is a good source for the same.

Manoj Srivastava
S.K. Chan
Honored Contributor

Re: How to automate automic clock sync.

An example of a simple implementation of NTP you can do.. (use one server as your master clock).

NTP Server
----------
o Edit "netdaemons" config file :-
# vi /etc/rc.config.d/netdaemons
....
export XNTPD=1
....

o Check to make sure timezone is correct (file /etc/TIMEZONE).

o Edit /etc/ntp.conf
# vi /etc/ntp.conf
server 127.127.1.1 # Psuedo IP identifies this system as time source
fudge 127.127.1.1 stratum 10 # Stratum 10 means it's not a reliable time source

o Start NTP
# /sbin/init.d/xntpd start

o Check asociation
# /usr/sbin/ntpq -p


NTP Clients
-----------
o The clients which is on the same subnet would have this in their ntp.conf file.

broadcastclient yes
driftfile /etc/ntp.drift

o Touch /etc/ntp.drift file
# touch /etc/ntp.drift

o Run "ntpq" to check status ..
# /usr/sbin/ntpq -p


Bill Hassell
Honored Contributor

Re: How to automate automic clock sync.

Be sure to specify multiple time servers, not just one. NTP will evaluate all the servers and use only the most reliable ones. Note that if you are behind a firewall, these NTP servers may not be visible as your firewall blocks access. In this case, have your network team add several NTP servers to the router and configure the router as your NTYP timesource. Most modern routers have this capability.

Use ntpq to query the NTP servers. If it works, the server is visible:

ntpq -p time-nw.nist.gov


Bill Hassell, sysadmin