[Git][NTPsec/ntpsec][master] Deleted 1 commit: Add html to header and footer.

Eric S. Raymond gitlab at mg.gitlab.com
Wed Aug 17 20:56:24 UTC 2016


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


WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below.


Deleted commits:
febc1b2b by Gary E. Miller at 2016-08-17T16:56:15-04:00
Add html to header and footer.

No cache, refresh every 30 mins, en_US, timestamp, etc.

- - - - -


1 changed file:

- ntpstats/ntpviz


Changes:

=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -2,7 +2,7 @@
 """\
 ntpviz - logfile visualizer for NTP log files
 
-Usage: ntpviz [-d statsdir] [-g] [-n name] [-p period]
+Usage: ntpviz [-d statsdir] [-g] [-n name] [-p days]
               [-s starttime]  [-e endtime]
               [--local-offset | --local-error | --local-jitter | --local-stability]
               [--peer-offsets=hosts | --all-peer-offsets]
@@ -16,7 +16,7 @@ Python by ESR, concept and GNUPLOT code by Dan Drown.
 #SPDX-License-Identifier: BSD-2-Clause
 from __future__ import print_function, division
 
-import os, sys, getopt, socket, binascii
+import os, sys, getopt, socket, binascii, datetime
 from ntpstats import *
 
 # RMS frequency jitter - Deviation from a root-mean-square linear approximation?
@@ -154,13 +154,13 @@ plot \\
 	plot_template = plot_template.replace("@", "%")
         for key in peerlist:
             plot_template += "'-' using 1:($%d*1000000) title '%s' with line, \\\n" % (fld, self.ip_label(key))
-        
+
         plot_template = plot_template[:-4] + "\n"
         for key in peerlist:
             # Trickiness - we allow peerlist elements to be DNS names.
             # The socket.gethostbyname() call maps DNS names to IP addresses,
             # passing through literal IPv4 addresses unaltered.  However,
-            # it barfs on either literal IPv6 addresses or refclock names. 
+            # it barfs on either literal IPv6 addresses or refclock names.
             if "(" in key or "::" in key:
                 ip = key
             else:
@@ -212,7 +212,7 @@ if __name__ == '__main__':
     except getopt.GetoptError as err:
         sys.stderr.write(str(err) + "\n")
         raise SystemExit(2)
-    period = 7	# days
+    period_days = 7	# days
     sitename = None
     statsdirs = ["/var/log/ntpstats"]
     endtime = starttime = None
@@ -234,7 +234,7 @@ if __name__ == '__main__':
         elif switch == "-n":
             sitename = val
         elif switch == "-p":
-            period = int(val)	# Denominated in days
+            period_days = int(val)	# Denominated in days
         elif switch == "-s":
             starttime = iso_to_posix(val)
         elif switch == "-o":
@@ -257,7 +257,7 @@ if __name__ == '__main__':
             show_peer_jitters = []
         elif switch == "--peer-rtt":
             show_peer_rtt = val
-    period *= 24 * 60 * 60
+    period = 24 * 60 * 60 * period_days
     statlist = [NTPViz(statsdir=d, sitename=sitename) for d in statsdirs]
     for stats in statlist:
         # Default to one week before the latest date
@@ -330,17 +330,38 @@ if __name__ == '__main__':
                 raise SystemExit(1)
         with open(os.path.join(outdir, "ntpsec-logo.png"), "w") as wp:
             wp.write(binascii.a2b_base64(ntpsec_logo))
+
+        now = datetime.datetime.utcnow()
         index_header = '''\
 <!DOCTYPE html>
 <html>
 <head>
 <meta charset="UTF-8">
+<meta http-equiv="refresh" content="1800">
+<meta http-equiv="expires" content="0">
+<meta http-equiv="cache-content" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="content-language" content="en_US">
 <title>ntpviz plot</title>
 </head>
 <body>
-<img sec="ntpsec-logo.png"/>
+<a href='https://www.ntpsec.org/'>
+<img src="ntpsec-logo.png" alt="NTPsec" style="float:left;margin:5px 50px;">
+</a>
+<div>
+<h1 style="margin-bottom:10px;">NTP Stats</h1>
 '''
+        index_header += 'Last Update: %s UTC <br>' %  now.strftime("%c")
+        index_header += 'Period: %s days <br></div> ' %  period_days
+        index_header += '<div style="clear:both;"/>'
+
         index_trailer = '''\
+<br>
+<br>
+<br>
+This page autogenerated by <a href="https://docs.ntpsec.org/latest/ntpviz.html">
+ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
+<br><br>
 </body>
 </html>
 '''



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/febc1b2bed22e6e4e9cdb0a7bba59c3c6574020a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160817/82d346c7/attachment.html>


More information about the vc mailing list