1825163 Members
3719 Online
109679 Solutions
New Discussion юеВ

xntpd daemon

 
SOLVED
Go to solution
Tarek
Super Advisor

xntpd daemon

Hi all,
i wanna enable this daemon to start on boot. Using hpux11.00. I think i have to create a server and the others as clients, right?? How to do that??
Thanks...
25 REPLIES 25
Carsten Krege
Honored Contributor

Re: xntpd daemon

You can configure ntp in SAM.

Documentation on ntp and its various functionalities can be found on www.ntp.org.

Ciao: Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
Animesh Chakraborty
Honored Contributor

Re: xntpd daemon

hi,
First of all, please made a change in your time server configuration file:

NTP Time server
===========
# cd /etc/
# /sbin/init.d/xntp stop
# vi ntp.conf
((modify the parameter accordingly & save it; broadcast adddress can be
obtained by running the command" ifconfig lan0, get the last entry which
shows something like: 192.23.24.255)):

server 127.127.1.1 minpoll 3 maxpoll 4 prefer
fudge 127.127.1.1 stratum 10
broadcast

# /sbin/init.d/xntp start

NTP Client
======
# cd /etc/rc.config.d
# /sbin/init.d/xntp stop
# vi netdaemons
((modify accordingly)):
export NTPDATE_SERVER=ctxpss
export XNTPD=1
# ntpdate (time Server)
# /sbin/init.d/xntp start

Wait for about 5-8 min, run the follwoing to check the status:
# ntpq -c rv
chk for output of "reftime" it shld not be zero if the servers are in sync.

Regards

Animesh

Did you take a backup?
James R. Ferguson
Acclaimed Contributor

Re: xntpd daemon

Hi Tarek:

A good guide to setting up Network Time Protocol (NTP) can be found in the "Installing and Administering Internet Services" manual:

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

A good list of available time can be found here:

http://www.eecis.udel.edu/~mills/ntp/clock1.htm
If you wish to synchronize locally take a look at document #A5864817. You can use one of your servers as a "master" clock for the remaining ones without going outside of your local network.

...JRF...
Tarek
Super Advisor

Re: xntpd daemon

I don't have an ntp client and server..i have to configure them..i have a nis master server..is it that to configure also as ntp server?? I never made this before..so if you can be so kind to describe everything exactly that will be very helpful for me..
Andreas D. Skjervold
Honored Contributor

Re: xntpd daemon

Hi

here is from HP docs:

Document ID: 1100390400
Date Loaded: 20001201
Title: NTP: setting up a simple xntp environment

PROBLEM

What procedure is used to setup a simple xntp environment?

CONFIGURATION

Operating System - HP-UX
Version - 11.0
Subsystem - NTP (Network Time Protocol)

RESOLUTION

To setup a simple xntp environment:

Server Setup
1. Start SAM (System Administration Manager):
A. Go to Time.
B. Go to NTP Network TIME Sources.
C. Select Actions/Configure NTP Local Clock: set to local clock
Note: Check /etc/ntp.conf. If server is 127.127.1.10,
change it to 127.127.1.1)

2. A. Select List/NTP_Broadcasting.
B. Select Actions/Add Broadcast Client Network.
C. Select broadcast address (enter or click) to get a list
(prefer "subnet".255
for example, 192.19.12.255 if mask is 255.255.255.0)
D. Select OK (twice).

3. Select Actions/Start NTP

Client Setup

1. Start SAM (System Administration Manager):
A. Go to Time.
B. Go to NTP Network TIME Sources.
C. Select Actions/Add Remote Server or Peer
D. Enter hostname, or server IP address
(for example, 192.19.12.5)
E. Select OK.

2. A. Select List/NTP_Broadcasting
B. Select Actions/Enable Receiving Time Broadcasts.

3. Select Actions/Start NTP

Note: It may take 5 to 15 minutes before synchronization occurs.
Only by ignoring what everyone think is important, can you be aware of what everyone ignores!
Pedro Sousa
Honored Contributor
Solution

Re: xntpd daemon

Hi Tarek!
This document is intended to function as a basic guideline to
get a single UX host to sync via xntpd with another single UX host.
On the system intended as the server:

NOTE: The system acting as the server must sync to itself or to
another server before clients can gain date information from it.

1. Verify which version of ntp your system is running with the what
command:

what /usr/sbin/xntpd

If this command fails to report the version information (patch
[PHNE_9056/PACHRDME/English] released v3.5f without what
information in the binary...
other versions may also be released this way in the future) do the
following:

a. Start the xntpd daemon:
#/usr/sbin/xntpd

b. Kill the xntpd daemon you just started.

c. grep xntpd /var/adm/syslog/syslog.log
Look for the version information such as:
Jun 4 12:38:42 tuco xntpd[882]: xntpd version=3.5f...

2. Based on the version output from step 1, add the following
line to the /etc/ntp.conf file.
For version 3.4 and older:
server 127.127.1.10

For version 3.5 and later:
server 127.127.1.1

3. Start xntpd.
a. Edit /etc/rc.config.d/netdaemons and set the following line as
shown:
XNTPD=1

b. /sbin/init.d/xntpd start

4. Give the system about 5 minutes to sync and check the status with the
command:

#ntpq -c rv

Look for the value of the field 'reftime='. If the field is all
zeros the system has not yet synced to a server. Once a hex
value replaces the zeros, the system is ready to provide time
information to clients.

On the system intended as the client:

1. Edit the /etc/ntp.conf file and add the following line:

> server

2. Run ntpdate to perform initial clock syncronization (note,
xntpd must NOT be running on the client when this command
is entered).

ntpdate

3. Start xntpd.

a. Edit /etc/rc.config.d/netdaemons and set the following
line as shown:

XNTPD=1

b. /sbin/init.d/xntpd start

4. Verify the client can see the server with the command:

ntpq -p

Note: NTP is slow... and so there may be a delay of a couple of
minutes before this command reports any useful information.

5. Give the system about 5 minutes to sync and check the status with
the command:

ntpq -c rv

Look for the value of the field 'reftime='. If the field is all
zeros the system has not yet synced to a server. Once a hex
value replaces the zeros, the system is ready to provide time
information to clients.

Note: It is recommended to leave xntpd running on the client to gain
the most exact syncronization however, some environments prefer
to avoid the network traffic due to performance reasons. At a
minimum, the ntpdate command should be run every 12 hours on the
client via a cron job to ensure time syncronization.

hope this helps.
Tarek
Super Advisor

Re: xntpd daemon

Thanks all for your reply. I wanna start configure using your help and also the manual (Installing and administring internet services)
you told me to look.
I need to know the following things before starting:
- maybe i have a ntp server configured, how can i know which is without creating a new one?
- if it exists, can i create a new one only for 7-8 ws?
- to enable one ws as ntp server, can i use the ws i prefer or i have to follow some criterium??
The version i'm using of xntpd is 3.5f version.
James R. Ferguson
Acclaimed Contributor

Re: xntpd daemon

Hi Tarek:

An invaluable tool is setting up and debugging NTP is 'ntpq'. Take a look at the man pages (1M) for 'ntpq' and at the "Installing and Administering Internet Services" reference I provided above for more information.

# ntpq -p

...will show you what server is acting at the time source and whether or not you are synchronized to it.

Another thing to rememeber with NTP is that that synchronization will take a few minutes, and will fail if the time difference between hosts is more than about 1000 seconds.

...JRF...
Sachin Patel
Honored Contributor

Re: xntpd daemon

Hi Tarek,
Once you will set this up you need this.
I have attached the script that I uses to setup client. I wrote that when I start this sys admin job. It is not best script but it will be easy later on to setup new system in this ntp chain.

Sachin
Is photography a hobby or another way to spend $
Deshpande Prashant
Honored Contributor

Re: xntpd daemon

Hi Trek
The command ntpq -p on NTP client machine will tell you from where it is picking up time.
In our setup the main router on network pulls the atomic clock and rest all servers/workstations synchronizes to this router.
The atomic clock site addresses are already listed by James.
Thanks.
Prashant.
Take it as it comes.
Stefan Schulz
Honored Contributor

Re: xntpd daemon

Hi,

you can have several ntp timsources in your network. You decide in your client's configuration which timesource to use.

there is no special requirement for an ntp timeserver, just make sure it has a good workin clock.

I don't know a good way how to check for an ntp timeserver in your network, but you could use a portscanner and check for the UDP Port 123.

Hope this helps

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Tarek
Super Advisor

Re: xntpd daemon

I issued the command you just told me, ntpq -p on the clients i think are configured:
in their /etc/ntp.conf, at the end of the file there's this entry:
broadcastclient yes
And i see that the xntpd daemon is running:
ps -ef | grep xntpd
But while i issued this command, ntpq -p I have:
remote refid st t when poll reach delay offset disp
================================================
That's it! So i don't know which is my ntp server. So if i wanna configure a new one, can i configure it as server, and all the others as clients (about 8 ws) even though they are on different subnet?
To enable the xntpd daemon start at every boot, do i just have to put, in the /etc/rc.config.d/netdaemons XNTPD=1 ???
Really many thanks to all you for you precious help.
Tarek
Super Advisor

Re: xntpd daemon

I will configure an ntp server. Do I have to make, as nis, something like a slave, so if my ntp server is down it will switch automatically to the "slave"?
If this is possible, how can i do that?
John Payne_2
Honored Contributor

Re: xntpd daemon

You just set up more than 1 ntp server. Then you point the clients to both/multiple servers. You set 1 server in /etc/ntp.conf to 'prefer'. (Or in sam) Then if the prefered server goes down, the clients will first try it, and then after a failure, will try any other listed server.
Spoon!!!!
Bill Thorsteinson
Honored Contributor

Re: xntpd daemon

Turn on the stats on any client and it will record which
server(s) it is responding to. This should only take a
few seconds or minutes after the server is restarted.
The parameters statsdir, statistics, and filegen control
the statistics.

The following file from my time server synchronizes with
two atomic clocks. I have removed my alternate time
server which provides a third source. Choose your
own external clocks from the list of public time
servers at http://www.ntp.org. You can create as
many servers as you want but three it a reasonable
limit (see the site). The rest of your servers
should be clients of your servers.

# /etc/ntp.conf, configuration for xntpd

# ntpd will use syslog() if logfile is not defined
#logfile /var/log/ntpd

driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

server time.chu.nrc.ca
server time.nrc.ca
leereg_5
Frequent Advisor

Re: xntpd daemon

To configure xntpd:

1.Edit the xntpd configuration file /etc/ntp.conf. You can also use SAM to configure xntpd.

2.Determine how you want to configure xntpd by reading the rest of this chapter and the xntpd man page. Then add the appropriate statements in /etc/ntp.conf.

3.Set the environment variable XNTPD to 1 in the file /etc/rc.config.d/netdaemons. This causes xntpd to start automatically whenever the system is booted.

4.Set the appropriate value for your local time zone in the file /etc/TIMEZONE.

5.Run the xntpd startup script with the following command:
/sbin/init.d/xntpd start

Configuring relationships with other time servers.
Configuring a driftfile.
Configuring authentication.
Configuring external clocks.
Restricting incoming packets
For detail:
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90110/B2355-90110_top.html&con=/hpux/onlinedocs/B2355-90110/00/00/67-con.html&toc=/hpux/onlinedocs/B2355-90110/00/00/67-toc.html&searchterms=NTPD&queryid=20010730-184816




Always UNIX!
leereg_5
Frequent Advisor

Re: xntpd daemon

If you use Solaris, it should be configured like this:
NTP server:
#/etc/inet/cp ntp.server ntp.conf
#cd /etc/init.d
#./xntpd start
NTP client:
#/etc/inet/cp ntp.client ntp.conf
#cd /etc/init.d
#./xntpd start


Lee
Always UNIX!
Tarek
Super Advisor

Re: xntpd daemon

I followed Pedro Sousa's instructions and i started configuring ntp server and client.
I configured the server and then the client. While i'm following Pedro's point 3 to start xntpd i'm having the following error:
/usr/sbin/ntpdate: no server suitable for synchronization found
xntpd
But if i check the clock, i see that the time is correct (before i put a wrong time), and while i issue ntpq -p i have:
remote refid st when poll reach delay offset disp
================================================
#gehp180 LOCAL(1) 4 63 64 1 1.30 -9.76 15890.6
So it seems working!!
If it works, and i wanna configure new clients, it's better to use broadcast on the client or to "force" xntpd to point to the server i want. And if i want to configure two servers, one prefer, and the other as "backup", what should be an example entry in the /etc/ntp.conf ??
Thanks
Pedro Sousa
Honored Contributor

Re: xntpd daemon

Hi Tarek,
my fault...
you need to add the ntp server to /etc/rc.config.d/netdaemons
after this, it'll find the server whennever it starts. Do:
/sbin/init.d/xntpd stop
and
/sbin/init.d/xntpd start
good luck.
Tarek
Super Advisor

Re: xntpd daemon

Thanks Pedro!!
in the line:
export NTPDATE_SERVER= ntpserverip
Now can i configure about 8-9 clients to point to that server? If i want to make two servers, how can clients point to both servers? And does i have to configure the second server to point to the first server?
Pedro Sousa
Honored Contributor

Re: xntpd daemon

Hi again.
I have 2 ntp servers syncronizing with +/- 30 clients.
The 2nd server syncronizes by the 1st one. and the 1st one, is the only one that syncronizes with himself.
The clients point to the 2 servers (you can change the order in /etc/ntp.conf to split the traffic), this way, whennever one is unavailable they'll sync by the 2nd one.
Remember, this is one way of doing it, but if you wanna try other ones, read the docs given by JRF.

regards
Sachin Patel
Honored Contributor

Re: xntpd daemon

Hi Tarak,
You can setup second server to be same as first or you can point second server to first and then add client who point to second server.
If you have one master server and couple secondary server and number of client then
The best way to setup NTP is one master server and few secondary server then point all client to secondary.

On master's ntp.conf
server ip_of_external_source
peer ip_of_secondary_server
peer ip_of_another_secondary
...

On secondary's ntp.conf
peer ip_of_master_server
peer ip_of_secondary
....

on client's ntp.conf
server ip_of_secondary

Sachin

Is photography a hobby or another way to spend $
Tarek
Super Advisor

Re: xntpd daemon

Thanks all again. I have to use Pedro's tips instead pointing to external server because i think i'm not allowed to syncronize with the external, because of i'm behind a firewall. So my ntp server will syncronize itself..but this will be very risk, because if my ntp server wrongs, all my clients will wrong. How can i configure my ntp server to synconize with an external one? I saw JRF tips at this site http://www.eecis.udel.edu/~mills/ntp/clock1.htm ... what i have to do..just put in my /etc/ntp.conf one of those ip addresses? Sorry if I always ask you, but it's the first time that i'm trying to configure ntp...
Deshpande Prashant
Honored Contributor

Re: xntpd daemon

HI
If your machine is behind the fire wall, to pull clock from external automatic source, besides just adding entry in ntp.conf file, you will need to open up firewall for this machine.

Prashant.
Take it as it comes.