Operating System - HP-UX
1820879 Members
4232 Online
109628 Solutions
New Discussion юеВ

NTP Server & Client Synchronization Status

 
Devender Khatana
Honored Contributor

NTP Server & Client Synchronization Status

Hi,
We are having ntp server whcih is serving around 35 clients in our data centre. Is there any way to find out synchronization status of all clients from one single command. Usually we run remsh date for all servers and compare output to confirm synchronization. Allthough it is also done through a script only but is there some other way possible of simplifying it.

And can we have some command which will tell us the time deference in two times.

Regards,
Devender
Impossible itself mentions "I m possible"
5 REPLIES 5
Biswajit Tripathy
Honored Contributor

Re: NTP Server & Client Synchronization Status

Running "ntpq -p" on clinet should give you the details
of the status of NTP client. See NTP docs at
http://docs.hp.com/en/B2355-90774/ch04s02.html

- Biswajit
:-)
Biswajit Tripathy
Honored Contributor

Re: NTP Server & Client Synchronization Status

One clarification to my last reply.

NTP is a protocol where a client can track multiple
servers and use the time from one that it thinks is
the best. At the same time, it will still keep track of
other servers too and switch over to another server
if it thinks that it found a better one. The server
has no way of knowing if the client is going to use
it's time. So if you want to keep track of clients,
you will have to run the command on each client to
findout which server it is using. Instead of using
'date' in your script, you should be running "ntpq -p"
and parsing it's output.

I'm afraid, I don't have a better answer. If you
discover one, then post it here.

- Biswajit
:-)
RAC_1
Honored Contributor

Re: NTP Server & Client Synchronization Status

Get the list of clients.

for i in $(cat /tmp/client.list)
do
echo ${i}
ntpq -p ${i}
done

Anil
There is no substitute to HARDWORK
Bill Hassell
Honored Contributor

Re: NTP Server & Client Synchronization Status

Since you have many servers, you probably have a way to run a command on each of the servers from a high-security management system. One way is to use remsh but this requires a potentially unsecure .rhosts file exist on each remote machine. A better way is to use rexec which moves the responsibility for login/password verification to the central (secure) system. I do exactly this to verify the time on each machine in just a fraction of a second. If the clients are all HP-UX, running the /usr/sbin/ntpq -p command on each server will give you the current status. The first character in front of the time server name (from ntpq) defines the state of the server:

* = selected for sync
x = not selected due to errors
- = not selected due to errors
+ = deemed accurate
= not selected

The REACH value will be 377 on good servers, less on problem servers. When the network is quite stable, the POLL value will be 1024 indicating that time sync requests have been reduced to once every 1024 sec (17 minutes). If you have only one server (not a good idea for a data center), then it should always have * in front of the server's name.


Bill Hassell, sysadmin
Devender Khatana
Honored Contributor

Re: NTP Server & Client Synchronization Status

Thanks all for who responded. It really worked.

Regards,
Devender
Impossible itself mentions "I m possible"