1c0b746e5SOllivier RobertThis directory contains support for monitoring the local clock of xntp daemons. 2c0b746e5SOllivier Robert 3c0b746e5SOllivier RobertWARNING: The scripts and routines contained in this directory are bete realease! 4c0b746e5SOllivier Robert Do not depend on their correct operation. They are, however, in regular 5c0b746e5SOllivier Robert use at University of Erlangen-Nuernberg. No severe problems are known 6c0b746e5SOllivier Robert for this code. 7c0b746e5SOllivier Robert 8c0b746e5SOllivier Robert!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 9c0b746e5SOllivier RobertPLEASE THINK TWICE BEFORE STARTING MONITORING REMOTE XNTP DEAMONS !!!! 10c0b746e5SOllivier RobertMONITORING MAY INCREASE THE LOAD OF THE DEAMON MONITORED AND MAY 11c0b746e5SOllivier RobertINCREASE THE NETWORK LOAD SIGNIFICANTLY 12c0b746e5SOllivier Robert!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 13c0b746e5SOllivier Robert 14c0b746e5SOllivier Robert 15c0b746e5SOllivier RobertFiles are: 16c0b746e5SOllivier Robert 17c0b746e5SOllivier RobertREADME: 18c0b746e5SOllivier Robert This file 19c0b746e5SOllivier Robert 20c0b746e5SOllivier Robertntptrap: 21c0b746e5SOllivier Robert perl script to log ntp mode 6 trap messages. 22c0b746e5SOllivier Robert 23c0b746e5SOllivier Robert It sends a set_trap request to each server given and dumps the 24c0b746e5SOllivier Robert trap messages received. It handles refresh of set_trap. 25c0b746e5SOllivier Robert Currently it handles only NTP V2, however the NTP V3 servers 26c0b746e5SOllivier Robert also accept v2 requests. It will not interpret v3 system and peer 27c0b746e5SOllivier Robert stati correctly. 28c0b746e5SOllivier Robert 29c0b746e5SOllivier Robert usage: 30c0b746e5SOllivier Robert ntptrap [-n] [-p <port>] [-l <debug-output>] servers... 31c0b746e5SOllivier Robert 32c0b746e5SOllivier Robert -n: do not send set_trap requests 33c0b746e5SOllivier Robert 34c0b746e5SOllivier Robert port: port to listen for responses 35c0b746e5SOllivier Robert useful if you have a configured trap 36c0b746e5SOllivier Robert 37c0b746e5SOllivier Robert debug-output: file to write trace output to (for debugging) 38c0b746e5SOllivier Robert 39c0b746e5SOllivier Robert This script convinced me that ntp trap messages are only of 40c0b746e5SOllivier Robert little use. 41c0b746e5SOllivier Robert 42c0b746e5SOllivier Robertntploopstat: 43c0b746e5SOllivier Robert perl script to gather loop info statistics from xntpd via mode 7 44c0b746e5SOllivier Robert LOOP_INFO requests. 45c0b746e5SOllivier Robert 46c0b746e5SOllivier Robert This script collects data to allow monitoring of remote xntp servers 47c0b746e5SOllivier Robert where it is not possible to directly access the loopstats file 48c0b746e5SOllivier Robert produced by xntpd itself. Of course, it can be used to sample 49c0b746e5SOllivier Robert a local server if it is not configured to produce a loopstats file. 50c0b746e5SOllivier Robert 51c0b746e5SOllivier Robert Please note, this program poses a high load on the server as 52c0b746e5SOllivier Robert a communication takes place every delay seconds ! USE WITH CARE ! 53c0b746e5SOllivier Robert 54c0b746e5SOllivier Robert usage: 55c0b746e5SOllivier Robert ntploopstat [-d<delay>] [-t<timeout>] [-l <logfile>] [-v] [ntpserver] 56c0b746e5SOllivier Robert 57c0b746e5SOllivier Robert delay: number of seconds to wait between samples 58c0b746e5SOllivier Robert default: 60 seconds 59c0b746e5SOllivier Robert timeout: number of seconds to wait for reply 60c0b746e5SOllivier Robert default 12 seconds 61c0b746e5SOllivier Robert logfile: file to log samples to 62c0b746e5SOllivier Robert default: loopstats:<ntpserver>: 63c0b746e5SOllivier Robert (note the trailing colon) 64c0b746e5SOllivier Robert This name actually is a prefix. 65c0b746e5SOllivier Robert The file name is dynamically derived by appending 66c0b746e5SOllivier Robert the name of the month the sample belongs to. 67c0b746e5SOllivier Robert Thus all samples of a month end up in the same file. 68c0b746e5SOllivier Robert 69c0b746e5SOllivier Robert the format of the files generated is identical to the format used by 70c0b746e5SOllivier Robert xntpd with the loopstats file: 71c0b746e5SOllivier Robert MJD <seconds since midnight UTC> offset frequency compliance 72c0b746e5SOllivier Robert 73c0b746e5SOllivier Robert if a timeout occurs the next sample is tried after delay/2 seconds 74c0b746e5SOllivier Robert 75c0b746e5SOllivier Robert The script will terminate after MAX_FAIL (currently 60) consecutive errors. 76c0b746e5SOllivier Robert Errors are counted for: 77c0b746e5SOllivier Robert - error on send call 78c0b746e5SOllivier Robert - error on select call 79c0b746e5SOllivier Robert - error on recv call 80c0b746e5SOllivier Robert - short packet received 81c0b746e5SOllivier Robert - bad packet 82c0b746e5SOllivier Robert - error on open for logfile 83c0b746e5SOllivier Robert 84c0b746e5SOllivier Robertntploopwatch: 85c0b746e5SOllivier Robert perl script to display loop filter statistics collected by ntploopstat 86c0b746e5SOllivier Robert or dumped directly by xntpd. 87c0b746e5SOllivier Robert 88c0b746e5SOllivier Robert Gnuplot is used to produce a graphical representation of the sample 89c0b746e5SOllivier Robert values, that have been preprocessed and analysed by this script. 90c0b746e5SOllivier Robert 91c0b746e5SOllivier Robert It can either be called to produce a printout of specific data set or 92c0b746e5SOllivier Robert used to continously monitor the values. Monitoring is achieved by 93c0b746e5SOllivier Robert periodically reprocessing the logfiles, which are updated regularly 94c0b746e5SOllivier Robert either by a running ntploopstat process or by the running xntpd. 95c0b746e5SOllivier Robert 96c0b746e5SOllivier Robert usage: 97c0b746e5SOllivier Robert to watch statistics permanently: 98c0b746e5SOllivier Robert ntploopwatch [-v[<level>]] [-c <config-file>] [-d <working-dir>] 99c0b746e5SOllivier Robert 100c0b746e5SOllivier Robert to get a single print out specify also 101c0b746e5SOllivier Robert -P<printer> [-s<samples>] 102c0b746e5SOllivier Robert [-S <start-time>] [-E <end-time>] 103c0b746e5SOllivier Robert [-O <MaxOffs>] [-o <MinOffs>] 104c0b746e5SOllivier Robert 105c0b746e5SOllivier Robert level: level of verbosity for debugging 106c0b746e5SOllivier Robert config-file: file to read configurable settings from 107c0b746e5SOllivier Robert On each iteration it is checked and reread 108c0b746e5SOllivier Robert if it has been changed 109c0b746e5SOllivier Robert default: loopwatch.config 110c0b746e5SOllivier Robert working-dir: specify working directory for process, affects 111c0b746e5SOllivier Robert interpretation of relative file names 112c0b746e5SOllivier Robert 113c0b746e5SOllivier Robert All other flags are only useful with printing plots, as otherwise 114c0b746e5SOllivier Robert command line values would be replaced by settings from the config file. 115c0b746e5SOllivier Robert 116c0b746e5SOllivier Robert printer: specify printer to print plot 117c0b746e5SOllivier Robert BSD print systems semantics apply; if printer is omitted 118c0b746e5SOllivier Robert the name "ps" is used; plots are prepared using 119c0b746e5SOllivier Robert PostScript, thus the printer should best accept 120c0b746e5SOllivier Robert postscript input 121c0b746e5SOllivier Robert 122c0b746e5SOllivier Robert For the following see also the comments in loopwatch.config.SAMPLE 123c0b746e5SOllivier Robert 124c0b746e5SOllivier Robert samples: use last # samples from input data 125c0b746e5SOllivier Robert start-time: ignore input samples before this date 126c0b746e5SOllivier Robert end-time: ignore input samples after this date 127c0b746e5SOllivier Robert if both start-time and end-time are specified 128c0b746e5SOllivier Robert a given samples value is ignored 129c0b746e5SOllivier Robert MaxOffs: 130c0b746e5SOllivier Robert MinOffs: restrict value range 131c0b746e5SOllivier Robert 132c0b746e5SOllivier Robertloopwatch.config.SAMPLE: 133c0b746e5SOllivier Robert sample config file for ntploopwatch 134c0b746e5SOllivier Robert each configurable option is explained there 135c0b746e5SOllivier Robert 136c0b746e5SOllivier Robertlr.pl: 137c0b746e5SOllivier Robert linear regression package used by ntploopwatch to compute 138c0b746e5SOllivier Robert linear approximations for frequency and offset values 139c0b746e5SOllivier Robert within display range 140c0b746e5SOllivier Robert 141c0b746e5SOllivier Roberttimelocal.pl: 142c0b746e5SOllivier Robert used during conversion of ISO_DATE_TIME values specified in loopwatch 143c0b746e5SOllivier Robert config files to unix epoch values (seconds since 1970-01-01_00:00_00 UTC) 144c0b746e5SOllivier Robert 145c0b746e5SOllivier Robert A version of this file is distributed with perl-4.x, however, 146c0b746e5SOllivier Robert it has a bug related to dates crossing 1970, causing endless loops.. 147c0b746e5SOllivier Robert The version contained here has been fixed. 148c0b746e5SOllivier Robert 149c0b746e5SOllivier Robertntp.pl: 150c0b746e5SOllivier Robert perl support for ntp v2 mode 6 message handling 151c0b746e5SOllivier Robert WARNING: This code is beta level - it triggers a memory leak; 152c0b746e5SOllivier Robert as for now it is not quite clear, wether this is caused by a 153c0b746e5SOllivier Robert bug in perl or by bad usage of perl within this script. 154c0b746e5SOllivier Robert 155