The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
NTP server with aix & wintel clients chongkls77 AIX 0 09-05-2007 10:53 PM
Multihomed DNS Clients? deckard IP Networking 4 04-12-2007 09:57 PM
BOOTP on HP Thin clients chuk_uka Linux 2 01-30-2006 04:21 AM
Please help.Thin clients connecting to SCO. Chaitu.a SCO 1 07-18-2005 08:59 AM
FTP from AIX to 20 Windows clients sharuvman Shell Programming and Scripting 2 03-28-2003 06:40 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-03-2008
hottyspidy hottyspidy is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 2
Tracking NTP Clients

I need to find out the NTP Clients which are syncing with my NTP Server in a Unix(Linux/Solaris) Machine. For eg. How many Stratum 2 Servers sync the time with my Stratum1 Server. Is there any way to track it?

edit by bakunin: moving the thread to where it belongs: the technical forums.

Last edited by bakunin; 10-04-2008 at 07:17 AM..
  #2 (permalink)  
Old 10-07-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,893
Hrm, well, it would appear that ntpd 4.2.2p1 does not log enough info. It sends log info to syslog, but that seems to report only startup/shutdown/error info (even with "debug" level captured). I added the logfile option and got a status report in the logfile every time ntpd connected to an upstream stratus server.

Code:
 7 Oct 11:47:16 ntpd[32403]: synchronized to 193.79.237.14, stratum 1

But it never reported when it was used as a stratus server.

Patching the source code might be in order.

Last edited by otheus; 10-07-2008 at 06:56 AM.. Reason: i tested "Debug" level for syslog+ntp
  #3 (permalink)  
Old 10-07-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,893
You can also turn on IP filtering/logging to log incoming packets to port 123. Both Solaris IPF and Linux iptables support this feature. It won't tell you what stratum were used, but you might be able to figure that out from the packet headers and set the filters appropriately.
  #4 (permalink)  
Old 10-12-2008
MrC MrC is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 51
Use the ntpdc command:


Code:
ntpdc -c monlist

  #5 (permalink)  
Old 10-12-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,893
MrC is so right! Just a few tweaks to get what you want. This monlist ALSO prints "peers", meaning Stratum 1 hosts. What I do is print the peers, and exclude those from the monlist. Observe:

Code:
 # get peers
 /usr/sbin/ntpdc -n -c listpeers |awk '{print $2}' >/tmp/peers.$$

 # get all hosts connected to this ntp server
 /usr/sbin/ntpdc -c monlist |awk '{ print $1 }' | 
    fgrep -v -f /tmp/peers.$$    # exclude those from the first list
 rm -f /tmp/peers.$$

Afterwards, you might want to do forward IP host resolution on the list. The reason I use the -n command is because the ntpdc output chops long hostnames off at a certain column, rendering the grep trick useless.
Closed Thread

Bookmarks

Tags
ntp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:08 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0