/contrib/ntp/scripts/monitoring/README

https://bitbucket.org/freebsd/freebsd-head/ · #! · 158 lines · 120 code · 38 blank · 0 comment · 0 complexity · 9485ecd788f43b1f61efd1f7f3543cb7 MD5 · raw file

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