aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMatt Rude <[email protected]>2011-06-05 21:41:26 -0500
committerMatt Rude <[email protected]>2011-06-05 21:41:26 -0500
commit015c6fa0cd03fccfb6403c4a1044b9d1b40da8e0 (patch)
tree8a9f84c99923211bb2dcd1337989700b40b6d52f /scripts
parentce10b3ecd979c01d39e6931cfa4602abba4c9c76 (diff)
downloadtime.mattrude.com-015c6fa0cd03fccfb6403c4a1044b9d1b40da8e0.tar.gz
time.mattrude.com-015c6fa0cd03fccfb6403c4a1044b9d1b40da8e0.tar.bz2
time.mattrude.com-015c6fa0cd03fccfb6403c4a1044b9d1b40da8e0.zip
more small updates
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_graph.cgi18
-rwxr-xr-xscripts/do-build-graphs23
-rwxr-xr-xscripts/do-build-site9
-rwxr-xr-xscripts/do-xntp116
-rw-r--r--scripts/index.html5
-rw-r--r--scripts/templates/index-head31
-rw-r--r--scripts/templates/index-tail5
-rw-r--r--scripts/templates/template4
-rw-r--r--scripts/templates/template-host28
9 files changed, 168 insertions, 71 deletions
diff --git a/scripts/build_graph.cgi b/scripts/build_graph.cgi
index 69ed8cc..c154342 100755
--- a/scripts/build_graph.cgi
+++ b/scripts/build_graph.cgi
@@ -21,9 +21,9 @@
--font AXIS:8:
--font LEGEND:10:
--font UNIT:8:
-DEF:a="/var/www/time.mattrude.com/rrd/kriby-client.rrd":clients:AVERAGE
-DEF:b="/var/www/time.mattrude.com/rrd/kriby-client.rrd":abusive:AVERAGE
-LINE:a#002A97FF:"Clients:"
+DEF:a="/var/www/time.mattrude.com/rrd/kirby.mattrude.com-clients.rrd":clients:AVERAGE
+DEF:b="/var/www/time.mattrude.com/rrd/kirby.mattrude.com-clients.rrd":abusive:AVERAGE
+AREA:a#002A97FF:"Clients:"
GPRINT:a:LAST:"Current\:%8.2lf %s"
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"
@@ -52,9 +52,9 @@ GPRINT:b:MAX:"Maximum\:%8.2lf %s\n"
--font AXIS:8:
--font LEGEND:10:
--font UNIT:8:
-DEF:a="/var/www/time.mattrude.com/rrd/twyla-client.rrd":clients:AVERAGE
-DEF:b="/var/www/time.mattrude.com/rrd/twyla-client.rrd":abusive:AVERAGE
-LINE:a#002A97FF:"Clients:"
+DEF:a="/var/www/time.mattrude.com/rrd/twyla.mattrude.com-clients.rrd":clients:AVERAGE
+DEF:b="/var/www/time.mattrude.com/rrd/twyla.mattrude.com-clients.rrd":abusive:AVERAGE
+AREA:a#002A97FF:"Clients:"
GPRINT:a:LAST:"Current\:%8.2lf %s"
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"
@@ -82,9 +82,9 @@ GPRINT:b:MAX:"Maximum\:%8.2lf %s\n">
--font AXIS:8:
--font LEGEND:10:
--font UNIT:8:
-DEF:a="/var/www/time.mattrude.com/rrd/samantha-client.rrd":clients:AVERAGE
-DEF:b="/var/www/time.mattrude.com/rrd/samantha-client.rrd":abusive:AVERAGE
-LINE:a#002A97FF:"Clients:"
+DEF:a="/var/www/time.mattrude.com/rrd/samantha.mattrude.com-clients.rrd":clients:AVERAGE
+DEF:b="/var/www/time.mattrude.com/rrd/samantha.mattrude.com-clients.rrd":abusive:AVERAGE
+AREA:a#002A97FF:"Clients:"
GPRINT:a:LAST:"Current\:%8.2lf %s"
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"
diff --git a/scripts/do-build-graphs b/scripts/do-build-graphs
index 5ac970d..d88ccb3 100755
--- a/scripts/do-build-graphs
+++ b/scripts/do-build-graphs
@@ -53,8 +53,31 @@ GPRINT:a:LAST:"Now\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Avg\:%8.2lf %s" \
GPRINT:a:MAX:"Max\:%8.2lf %s\n" \
+${RRD_BIN}/rrdtool graph \
+ --imgformat=PNG ${GRAPHS}/samantha-clients.png \
+--start=-86400 --end=-300 \
+--title='Samantha - 174.143.173.49' \
+--rigid \
+--height=100 \
+--width=290 \
+--alt-autoscale-max \
+--lower-limit=0 \
+--vertical-label='Active Clients' \
+--slope-mode \
+--font TITLE:12: \
+--font AXIS:8: \
+--font LEGEND:8: \
+--font UNIT:8: \
+DEF:a="/var/www/time.mattrude.com/rrd/samantha-client.rrd":clients:AVERAGE \
+AREA:a#002A97FF:"" \
+GPRINT:a:LAST:"Now\:%8.2lf %s" \
+GPRINT:a:AVERAGE:"Avg\:%8.2lf %s" \
+GPRINT:a:MAX:"Max\:%8.2lf %s\n" \
+
+
/usr/bin/optipng ${GRAPHS}/kirby-clients.png
/usr/bin/optipng ${GRAPHS}/twyla-clients.png
+/usr/bin/optipng ${GRAPHS}/samantha-clients.png
#end
diff --git a/scripts/do-build-site b/scripts/do-build-site
index 4343370..0399467 100755
--- a/scripts/do-build-site
+++ b/scripts/do-build-site
@@ -7,11 +7,11 @@ mkdir -p $POOLPAGE
cd $POOLPAGE
cat /dev/null > out.template
-echo "<h2>NTP Hosts</h2>
+echo "<h2>Time Server Hosts</h2>
<ul>" >> out.template
for X in `cat /var/www/time.mattrude.com/rrd/list-of-systems`
do
- echo "<li><a href=$X>$X</a>" >> out.template
+ echo "<li><a href=/status/$X/>$X</a>" >> out.template
done
echo "</ul>" >> out.template
@@ -26,10 +26,11 @@ cat $TEMPLATESDIR/index-head out.template $TEMPLATESDIR/index-tail > $POOLPAGE/i
# Build the indexs for the hosts.
for X in `cat /var/www/time.mattrude.com/rrd/list-of-systems`
do
+ mkdir -p $POOLPAGE/$X
cat /dev/null > out.template
- sed -e s/POOL/$X/g $TEMPLATESDIR/template3 >> out.template
+ sed -e s/POOL/$X/g $TEMPLATESDIR/template-host >> out.template
sync
- cat $TEMPLATESDIR/index-head out.template $TEMPLATESDIR/index-tail > $X.html
+ cat out.template $TEMPLATESDIR/index-tail > $X/index.html
rm -f out.template
done
chown -R apache:apache $POOLPAGE
diff --git a/scripts/do-xntp b/scripts/do-xntp
index 2d09a3c..4b91bc5 100755
--- a/scripts/do-xntp
+++ b/scripts/do-xntp
@@ -3,6 +3,15 @@
RRD_BIN=/usr/bin
RRDPAGE=/var/www/time.mattrude.com/rrd
SCRIPTS=/var/www/time.mattrude.com/scripts
+STATUS=/var/www/time.mattrude.com/status
+
+rsync -a samantha:/var/www/time.mattrude.com/rrd/samantha-client.rrd /var/www/time.mattrude.com/rrd/samantha.mattrude.com-clients.rrd
+rsync -a twyla:/var/www/time.mattrude.com/rrd/twyla-client.rrd /var/www/time.mattrude.com/rrd/twyla.mattrude.com-clients.rrd
+rsync -a kirby:/var/www/time.mattrude.com/rrd/kriby-client.rrd /var/www/time.mattrude.com/rrd/kirby.mattrude.com-clients.rrd
+
+rsync -a /var/www/time.mattrude.com/rrd/kirby.mattrude.com-clients.rrd twyla:/var/www/time.mattrude.com/rrd/kirby.mattrude.com-client.rrd
+rsync -a /var/www/time.mattrude.com/rrd/twyla.mattrude.com-clients.rrd twyla:/var/www/time.mattrude.com/rrd/twyla.mattrude.com-client.rrd
+rsync -a /var/www/time.mattrude.com/rrd/samantha.mattrude.com-clients.rrd twyla:/var/www/time.mattrude.com/rrd/samantha.mattrude.com-client.rrd
cd ${RRDPAGE}
@@ -16,62 +25,102 @@ sh ${SCRIPTS}/do-ntp-rrdstats ${X}
if [ ! $? ]; then exit 1; fi
+#${RRD_BIN}/rrdtool graph \
+# --imgformat PNG ${STATUS}/${X}/ntp-clients.png \
+# --width 600 --height 200 \
+# --vertical-label "${X}" \
+# --title "`TZ=UTC date`" \
+# --start -93600 \
+# DEF:clients=${RRDPAGE}/${X}-clients.rrd:clients:AVERAGE \
+# CDEF:noclients=clients,1,/ \
+# AREA:noclients#0000FF:"Cients" \
+# GPRINT:noclients:LAST:%le
+
${RRD_BIN}/rrdtool graph \
- --imgformat PNG ${RRDPAGE}/${X}-ntp-offset.png \
+--imgformat PNG ${STATUS}/${X}/ntp-clients.png \
+--lazy \
+--imgformat=PNG \
+--start=-86400 \
+--end=-300 \
+--title="${X} - Number of Active Clients" \
+--rigid \
+--height=200 \
+--width=600 \
+--alt-autoscale-max \
+--lower-limit=0 \
+--vertical-label='Number of Clients' \
+--slope-mode \
+--font TITLE:12: \
+--font AXIS:8: \
+--font LEGEND:10: \
+--font UNIT:8: \
+DEF:a="/var/www/time.mattrude.com/rrd/${X}-clients.rrd":clients:AVERAGE \
+DEF:b="/var/www/time.mattrude.com/rrd/${X}-clients.rrd":abusive:AVERAGE \
+AREA:a#002A97FF:"Clients:" \
+GPRINT:a:LAST:"Current\:%8.2lf %s" \
+GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
+GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" \
+AREA:b#F51D30FF:"Abusive:" \
+GPRINT:b:LAST:" Current\:%8.2lf %s" \
+GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
+GPRINT:b:MAX:"Maximum\:%8.2lf %s\n"
+
+${RRD_BIN}/rrdtool graph \
+ --imgformat PNG ${STATUS}/${X}/ntp-offset.png \
--width 600 --height 200 \
--vertical-label "${X}" \
--title "`TZ=UTC date`" \
--start -93600 \
DEF:offset=${RRDPAGE}/${X}.rrd:offset:LAST \
CDEF:noffset=offset,1000,/ \
- LINE1:noffset#0000FF:"offset" \
+ AREA:noffset#0000FF:"offset" \
GPRINT:noffset:LAST:%le
${RRD_BIN}/rrdtool graph \
- --imgformat PNG ${RRDPAGE}/${X}-ntp-sysjit.png \
+ --imgformat PNG ${STATUS}/${X}/ntp-sysjit.png \
--width 600 --height 200 \
--vertical-label "${X}" \
--title "`TZ=UTC date`" \
--start -93600 \
DEF:sjit=${RRDPAGE}/${X}.rrd:sjit:LAST \
CDEF:nsjit=sjit,1000,/ \
- LINE1:nsjit#0000FF:"sysjit" \
+ LINE2:nsjit#0000FF:"sysjit" \
GPRINT:nsjit:LAST:%le
${RRD_BIN}/rrdtool graph \
- --imgformat PNG ${RRDPAGE}/${X}-ntp-clkjit.png \
+ --imgformat PNG ${STATUS}/${X}/ntp-clkjit.png \
--width 600 --height 200 \
--vertical-label "${X}" \
--title "`TZ=UTC date`" \
--start -93600 \
DEF:cjit=${RRDPAGE}/${X}.rrd:cjit:LAST \
CDEF:ncjit=cjit,1000,/ \
- LINE1:ncjit#0000FF:"cjit" \
+ LINE2:ncjit#0000FF:"cjit" \
GPRINT:ncjit:LAST:%le
${RRD_BIN}/rrdtool graph \
- --imgformat PNG ${RRDPAGE}/${X}-ntp-wander.png \
+ --imgformat PNG ${STATUS}/${X}/ntp-wander.png \
--width 600 --height 200 \
--vertical-label "${X}" \
--title "`TZ=UTC date`" \
--start -93600 \
DEF:wander=${RRDPAGE}/${X}.rrd:wander:LAST \
- LINE1:wander#0000FF:"Wander" \
+ LINE2:wander#0000FF:"Wander" \
GPRINT:wander:LAST:%le
${RRD_BIN}/rrdtool graph \
- --imgformat PNG ${RRDPAGE}/${X}-ntp-freq.png \
+ --imgformat PNG ${STATUS}/${X}/ntp-freq.png \
--width 600 --height 200 \
--alt-autoscale \
--vertical-label "${X}" \
--title "`TZ=UTC date`" \
--start -93600 \
DEF:freq=${RRDPAGE}/${X}.rrd:freq:LAST \
- LINE1:freq#0000FF:"Frequency (ppm)" \
+ AREA:freq#0000FF:"Frequency (ppm)" \
GPRINT:freq:LAST:%lf
${RRD_BIN}/rrdtool graph \
- --imgformat PNG ${RRDPAGE}/${X}-ntp-disp.png \
+ --imgformat PNG ${STATUS}/${X}/ntp-disp.png \
--width 600 --height 200 \
--alt-autoscale \
--vertical-label "${X}" \
@@ -79,76 +128,87 @@ ${RRD_BIN}/rrdtool graph \
--start -93600 \
DEF:disp=${RRDPAGE}/${X}.rrd:disp:LAST \
CDEF:ndisp=disp,1000,/ \
- LINE1:ndisp#0000FF:"Dispersion" \
+ AREA:ndisp#0000FF:"Dispersion" \
GPRINT:ndisp:LAST:%lf
${RRD_BIN}/rrdtool graph \
- --imgformat PNG ${RRDPAGE}/${X}-ntp-jitter.png \
+ --imgformat PNG ${STATUS}/${X}/ntp-jitter.png \
--width 600 --height 200 \
--alt-autoscale \
--vertical-label "${X}" \
--title "`TZ=UTC date`" \
--start -93600 \
DEF:disp=${RRDPAGE}/${X}.rrd:jitter:LAST \
- LINE1:disp#0000FF:"Jitter" \
+ LINE2:disp#0000FF:"Jitter" \
GPRINT:disp:LAST:%lf
# fat (weekly) graphs
-${RRD_BIN}/rrdtool graph --imgformat PNG ${RRDPAGE}/${X}-week-ntp-offset.png \
+${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/week-ntp-clients.png \
+ --width 600 --height 200 \
+ --vertical-label "${X}" \
+ --title "`TZ=UTC date`" \
+ --start -691200 \
+ DEF:clients=${RRDPAGE}/${X}-clients.rrd:clients:AVERAGE \
+ CDEF:nclients=clients,1000,/ \
+ AREA:nclients#0000FF:"clients" \
+ GPRINT:nclients:LAST:%le
+
+
+${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/week-ntp-offset.png \
--width 600 --height 200 \
--vertical-label "${X}" \
--title "`TZ=UTC date`" \
--start -691200 \
DEF:offset=${RRDPAGE}/${X}.rrd:offset:LAST \
CDEF:noffset=offset,1000,/ \
- LINE1:noffset#0000FF:"offset" \
+ AREA:noffset#0000FF:"offset" \
GPRINT:noffset:LAST:%le
-${RRD_BIN}/rrdtool graph --imgformat PNG ${RRDPAGE}/${X}-week-ntp-sysjit.png \
+${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/week-ntp-sysjit.png \
--width 600 --height 200 \
--vertical-label "${X}" \
--title "`TZ=UTC date`" \
--start -691200 \
DEF:sjit=${RRDPAGE}/${X}.rrd:sjit:LAST \
CDEF:nsjit=sjit,1000,/ \
- LINE1:nsjit#0000FF:"sysjit" \
+ LINE2:nsjit#0000FF:"sysjit" \
GPRINT:nsjit:LAST:%le
-${RRD_BIN}/rrdtool graph --imgformat PNG ${RRDPAGE}/${X}-week-ntp-clkjit.png \
+${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/week-ntp-clkjit.png \
--width 600 --height 200 \
--vertical-label "${X}" \
--title "`TZ=UTC date`" \
--start -691200 \
DEF:cjit=${RRDPAGE}/${X}.rrd:cjit:LAST \
CDEF:ncjit=cjit,1000,/ \
- LINE1:ncjit#0000FF:"clkjit" \
+ LINE2:ncjit#0000FF:"clkjit" \
GPRINT:ncjit:LAST:%le
-${RRD_BIN}/rrdtool graph --imgformat PNG ${RRDPAGE}/${X}-week-ntp-wander.png \
+${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/week-ntp-wander.png \
--width 600 --height 200 \
--vertical-label "${X}" \
--title "`TZ=UTC date`" \
--start -691200 \
DEF:wander=${RRDPAGE}/${X}.rrd:wander:LAST \
- LINE1:wander#0000FF:"wander" \
+ LINE2:wander#0000FF:"wander" \
GPRINT:wander:LAST:%le
${RRD_BIN}/rrdtool graph \
- --imgformat PNG ${RRDPAGE}/${X}-week-ntp-freq.png \
+ --imgformat PNG ${STATUS}/${X}/week-ntp-freq.png \
--width 600 --height 200 \
--alt-autoscale \
--vertical-label "${X}" \
--title "`TZ=UTC date`" \
--start -691200 \
DEF:freq=${RRDPAGE}/${X}.rrd:freq:LAST \
- LINE1:freq#0000FF:"frequency (ppm)" \
+ AREA:freq#0000FF:"frequency (ppm)" \
GPRINT:freq:LAST:%lf
${RRD_BIN}/rrdtool graph \
- --imgformat PNG ${RRDPAGE}/${X}-week-ntp-disp.png \
+ --imgformat PNG ${STATUS}/${X}/week-ntp-disp.png \
--width 600 --height 200 \
--alt-autoscale \
--vertical-label "${X}" \
@@ -156,11 +216,11 @@ ${RRD_BIN}/rrdtool graph \
--start -691200 \
DEF:disp=${RRDPAGE}/${X}.rrd:disp:LAST \
CDEF:ndisp=disp,1000,/ \
- LINE1:ndisp#0000FF:"dispersion" \
+ AREA:ndisp#0000FF:"dispersion" \
GPRINT:ndisp:LAST:%lf
${RRD_BIN}/rrdtool graph \
- --imgformat PNG ${RRDPAGE}/${X}-week-ntp-jitter.png \
+ --imgformat PNG ${STATUS}/${X}/week-ntp-jitter.png \
--width 600 --height 200 \
--alt-autoscale \
--vertical-label "${X}" \
@@ -168,7 +228,7 @@ ${RRD_BIN}/rrdtool graph \
--start -691200 \
DEF:disp=${RRDPAGE}/${X}.rrd:jitter:LAST \
CDEF:ndisp=disp,1000,/ \
- LINE1:ndisp#0000FF:"Jitter" \
+ LINE2:ndisp#0000FF:"Jitter" \
GPRINT:ndisp:LAST:%lf
done
diff --git a/scripts/index.html b/scripts/index.html
deleted file mode 100644
index 9a3a943..0000000
--- a/scripts/index.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<HTML>
-<head></head>
-<body>
- <!-- ummmm, no -->
-</body>
diff --git a/scripts/templates/index-head b/scripts/templates/index-head
index 37fc159..36b4b12 100644
--- a/scripts/templates/index-head
+++ b/scripts/templates/index-head
@@ -1,28 +1,13 @@
<head>
- <title>Time Server Status</title>
- <link rel="stylesheet" type="text/css" href="style.css"/>
+ <title>time.mattrude.com :: Time Server Status Page</title>
+ <link rel="stylesheet" type="text/css" href="/style.css"/>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
</head>
<html>
-<title>experimental ntp tech info</title>
<body>
-<h2>
-NTP Status Page
-</h2>
-<p>
-Legends (taken from
-<a href="http://www.eecis.udel.edu/~mills/ntp/html/ntpq.html">
-http://www.eecis.udel.edu/~mills/ntp/html/ntpq.html</a>):
-<br>
-<pre>
-offset combined time offset
-frequency clock frequency offset (PPM)
-sys_jitter combined system jitter
-clk_jitter clock jitter
-clk_wander clock frequency wander (PPM)
-rootdisp total dispersion to the primary reference clock
-</pre>
-<br>
-<p>
-
-
+<div id="content">
+ <div id="primary" class="main">
+ <div id="title">
+ <h2>Time Server Status Page</h2>
+ </div>
+<p> / <a href="/">time.mattrude.com</a> / <strong>status</strong> / </p>
diff --git a/scripts/templates/index-tail b/scripts/templates/index-tail
index 102f439..d6134f2 100644
--- a/scripts/templates/index-tail
+++ b/scripts/templates/index-tail
@@ -1,3 +1,8 @@
<p>
+</div>
+<div class="footer">
+ <p>Copyright &copy; 2009 &mdash; 2011 by <a href='http://mattrude.com'>Matt Rude</a></p>
+</div>
+</div>
</body>
</html>
diff --git a/scripts/templates/template b/scripts/templates/template
index 01137fd..3aefa90 100644
--- a/scripts/templates/template
+++ b/scripts/templates/template
@@ -1,5 +1,5 @@
<p>
-<h2>Host: POOL</h2>
+<h2>Time Server: POOL</h2>
<p>
-<a href="POOL.html"><img src="/rrd/POOL-ntp-offset.png"></a>
+<a href="POOL/"><img src="/status/POOL/ntp-clients.png"></a>
</p>
diff --git a/scripts/templates/template-host b/scripts/templates/template-host
index d893448..51c57ad 100644
--- a/scripts/templates/template-host
+++ b/scripts/templates/template-host
@@ -1,3 +1,31 @@
+<head>
+ <title>time.mattrude.com :: POOL Time Server Status Page</title>
+ <link rel="stylesheet" type="text/css" href="/style.css"/>
+ <link rel="icon" href="/favicon.ico" type="image/x-icon" />
+</head>
+<html>
+<body>
+<div id="content">
+ <div id="primary" class="main">
+<div id="title">
+ <h2>POOL NTP Status Page</h2>
+</div>
+<p> / <a href="/">time.mattrude.com</a> / <a href="/status/">status</a> / <strong>POOL</strong></p>
+<p>
+Legends (taken from
+<a href="http://www.eecis.udel.edu/~mills/ntp/html/ntpq.html">
+http://www.eecis.udel.edu/~mills/ntp/html/ntpq.html</a>):
+</p>
+<pre>
+offset combined time offset
+frequency clock frequency offset (PPM)
+sys_jitter combined system jitter
+clk_jitter clock jitter
+clk_wander clock frequency wander (PPM)
+rootdisp total dispersion to the primary reference clock
+</pre>
+<br>
+
<p>
<h2>Host POOL, Daily Status</h2>
<p>