1825060 Members
5288 Online
109679 Solutions
New Discussion юеВ

Simple NTP configuration

 
SOLVED
Go to solution
geir_2
Super Advisor

Simple NTP configuration

I want to configure two HP-UX as a NTP client.
The address of the NTP servers is:

10.0.25.91/92
10.0.26.91/92


Any ideas??

Thanks


Geir
15 REPLIES 15
Pete Randall
Outstanding Contributor

Re: Simple NTP configuration

Use SAM:

sam > Time > NTP Network Time Sources


Pete

Pete
Robert-Jan Goossens
Honored Contributor

Re: Simple NTP configuration

Hi Geir,

Start SAM, Time, NTP Network Time Sources, Actions, Add Remote server or Peer.

Regards,
Robert-Jna
Luk Vandenbussche
Honored Contributor

Re: Simple NTP configuration

Hi Geir,

Just use

/usr/sbin/ntpdate 10.0.25.91

I have added the following line to crontab of root. So the time is synchronized twice a day

0 0,12 * * * /usr/sbin/ntpdate 10.0.25.91 > /dev/null



Jeff Schussele
Honored Contributor

Re: Simple NTP configuration

Hi Geir,

Just add the following lines to /etc/ntp.conf

server 10.0.25.91 version 3 prefer
server 10.0.26.91 version 3

Use the closest server as the "prefer" server for the clients.

Then if the clients are *less* than 15 minuters away in actual time, start the clients by:

1) Editing /etc/rc.config.d/netdaemons so that
XNTPD=1
2) Start the client with
/sbin/init.d/xntpd start

That's all there is to it.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
john kingsley
Honored Contributor

Re: Simple NTP configuration

Edit /etc/rc.config.d/netdaemons:
export NTPDATE_SERVER=10.0.25.91 10.0.25.92 10.0.26.91 10.0.26.92
export XNTPD=1
export XNTPD_ARGS=

Edit /etc/ntp.conf
server 10.0.25.91
server 10.0.25.92
server 10.0.26.91
server 10.0.26.92
driftfile /etc/ntp.drift

Patrick Wallek
Honored Contributor
Solution

Re: Simple NTP configuration

Using NTPDATE with applications up is not a good idea.

ntpdate will jump the clock to the new setting, no matter what the difference is. That has the potential to lead to database problems.

Your best bet is to either use SAM as mentioned above, or edit the /etc/ntp.conf file and add your time servers. There is a lot of good information in the /etc/ntp.conf file.

The simplest form is:

# cat /etc/ntp.conf
server 10.0.25.91
server 10.0.26.91

Then edit /etc/rc.config.d/netdaemons file and change the line:

export XNTPD=0

to

export XNTPD=1

You can also add one of your NTP Servers as the NTPDATE Server.

export NTPDATE_SERVER="10.0.25.91"

Then run '/sbin/init.d/xntpd start' to start ntp.

geir_2
Super Advisor

Re: Simple NTP configuration

One more question.

The xntpd process is already running. If I want the process to be restartet/reloaded with the new config, what is the command?

# kill -HUP pid_xntpd ?????

or

# kill -9 xntpd_pid +
+
# xntpd start
Arunvijai_4
Honored Contributor

Re: Simple NTP configuration

You can do the following,

#/sbin/init.d/xntpd stop
#/sbin/init.d/xntpd start

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
geir_2
Super Advisor

Re: Simple NTP configuration

Hi,

I got following messages when I try to stop the process:

# /sbin/init.d/xntpd stop
ERROR: Unable to stop the xntpd (cannot find pid).


Is it possible to use kill -9 xntpd_pid ??
Arunvijai_4
Honored Contributor

Re: Simple NTP configuration

Yes, Try to find out the pid of xntpd,
# ps -ae |grep -i xntpd
# kill -9

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
geir_2
Super Advisor

Re: Simple NTP configuration

Hi,

Is it possible to let the current process reread the config with the following command:

# kill -HUP xntpd_pid ???
Arunvijai_4
Honored Contributor

Re: Simple NTP configuration

Yes, Its possible to that, # kill -HUP

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
geir_2
Super Advisor

Re: Simple NTP configuration

Hi,

Is it possible control/verify that HP-UX is syncronized with NTP server??

Thanks
john kingsley
Honored Contributor

Re: Simple NTP configuration

run ntpq -p
Bill Hassell
Honored Contributor

Re: Simple NTP configuration

ntpq -p will test all the NTP servers listed in ntp.conf. All of them should have REACH=377. The POLL time is the number of seconds between sync requests. When the poll time is more than 64, the sync between the machines is stable. SImilarly, a low dispersion value is also a sign of good accuracy. ntpq is used to verify that the NTP sources are reachable and actually work correctly. Also look in /var/adm/syslog/syslog.log for NTP messages:

grep ntp /var/adm/syslog/syslog.log

xntpd will not try to synchronize if the difference is more than a few minutes.


Bill Hassell, sysadmin