[Git][NTPsec/ntpsec][master] Fix some issues in the ntpmon display.

Eric S. Raymond gitlab at mg.gitlab.com
Fri Dec 9 04:50:22 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
aa348219 by Eric S. Raymond at 2016-12-08T23:49:50-05:00
Fix some issues in the ntpmon display.

- - - - -


3 changed files:

- docs/includes/ntpq-body.txt
- ntpclients/ntpmon
- pylib/util.py


Changes:

=====================================
docs/includes/ntpq-body.txt
=====================================
--- a/docs/includes/ntpq-body.txt
+++ b/docs/includes/ntpq-body.txt
@@ -271,15 +271,18 @@ ind assid status conf reach auth condition last_event cnt
 
 +mrulist+ [+limited+ | +kod+ | +mincount=+'count' | +laddr=+'localaddr' | +sort=+'sortorder' | +resany=+'hexmask' | +resall=+'hexmask']::
   Obtain and print traffic counts collected and maintained by the
-  monitor facility. With the exception of +sort=+'sortorder', the options
-  filter the list returned by +ntpd+. The +limited+ and +kod+ options
-  return only entries representing client addresses from which the last
-  packet received triggered either discarding or a KoD response. The
-  +mincount=+'count' option filters entries representing less than 'count'
-  packets. The +laddr=+'localaddr' option filters entries for packets
-  received on any local address other than 'localaddr'. +resany=+'hexmask'
-  and +resall=+'hexmask' filter entries containing none or less than all,
-  respectively, of the bits in 'hexmask', which must begin with +0x+.
+  monitor facility. This is useful for tracking who _uses_ your
+  server.
++
+With the exception of +sort=+'sortorder', the options
+filter the list returned by +ntpd+. The +limited+ and +kod+ options
+return only entries representing client addresses from which the last
+packet received triggered either discarding or a KoD response. The
++mincount=+'count' option filters entries representing less than 'count'
+packets. The +laddr=+'localaddr' option filters entries for packets
+received on any local address other than 'localaddr'. +resany=+'hexmask'
+and +resall=+'hexmask' filter entries containing none or less than all,
+respectively, of the bits in 'hexmask', which must begin with +0x+.
 +
 The _sortorder_ defaults to +lstint+ and may be any of +addr+,
 +count+, +avgint+, +lstint+, or any of those preceded by a minus sign


=====================================
ntpclients/ntpmon
=====================================
--- a/ntpclients/ntpmon
+++ b/ntpclients/ntpmon
@@ -118,6 +118,7 @@ if __name__ == '__main__':
                                   curses.A_REVERSE|curses.A_DIM)
                     # Now the MRU report
                     span = session.mrulist()
+                    mru_report.now = time.time()
                     if span.entries:
                         stdscr.addstr(ntp.util.MRUSummary.header + "\n",
                                       curses.A_BOLD)


=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -319,16 +319,16 @@ class MRUSummary:
         self.showhostnames = showhostnames	# If false, display numeric IPs
         self.now = time.time()
 
-    header = "lstint avgint rstr r m v  count rport remote address"
+    header = " lstint avgint rstr r m v  count rport remote address"
 
-    width = 78
+    width = 79
 
     def summary(self, entry):
         lstint = int(self.now - entry.last + 0.5)
         active = float(entry.last - entry.first)
         favgint = active / entry.ct
         avgint = int(favgint + 0.5)
-        stats = "%6d" % lstint
+        stats = "%7d" % lstint
         if 5 < avgint or 1 == entry.ct:
             stats += " %6d" % avgint
         else:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/aa3482199560311fd21182ced26fb74c5c1a00f4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161209/00bb8459/attachment.html>


More information about the vc mailing list