aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rwxr-xr-xscripts/do-build-index18
-rwxr-xr-xscripts/do-newntpstat3
-rwxr-xr-xscripts/do-ntp-rrdstats6
-rwxr-xr-xscripts/do-xntp30
-rw-r--r--scripts/templates/template28
6 files changed, 51 insertions, 37 deletions
diff --git a/.gitignore b/.gitignore
index e6c2a60..4077f8a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,4 @@
mirrors/
+rrd/list-of-systems
+rrd/*.png
+rrd/*.rrd
diff --git a/scripts/do-build-index b/scripts/do-build-index
index b868fe6..3855b33 100755
--- a/scripts/do-build-index
+++ b/scripts/do-build-index
@@ -6,16 +6,28 @@ TEMPLATESDIR=/usr/local/www/data/scripts/templates
cd $POOLPAGE
cat /dev/null > out.template
+echo "<h2>NTP Hosts</h2>
+<ul>" >> out.template
for X in `cat /usr/local/www/data/rrd/list-of-systems`
do
- sed -e s/POOL/$X/g $TEMPLATESDIR/template >> out.template
+ echo "<li><a href=$X>$X</a>" >> out.template
done
+echo "</ul>" >> out.template
for X in `cat /usr/local/www/data/rrd/list-of-systems`
do
- sed -e s/POOL/$X/g $TEMPLATESDIR/template2 >> out.template
+ sed -e s/POOL/$X/g $TEMPLATESDIR/template >> out.template
done
sync
cat $TEMPLATESDIR/index-head out.template $TEMPLATESDIR/index-tail > index.html
-rm -f out.template
+
+# Build the indexs for the hosts.
+for X in `cat /usr/local/www/data/rrd/list-of-systems`
+do
+ cat /dev/null > out.template
+ sed -e s/POOL/$X/g $TEMPLATESDIR/template3 >> out.template
+ sync
+ cat $TEMPLATESDIR/index-head out.template $TEMPLATESDIR/index-tail > $X.html
+ rm -f out.template
+done
diff --git a/scripts/do-newntpstat b/scripts/do-newntpstat
index bae8b37..b45da14 100755
--- a/scripts/do-newntpstat
+++ b/scripts/do-newntpstat
@@ -16,11 +16,12 @@ ${RRD_BIN}/rrdtool create $1.rrd \
DS:wander:GAUGE:1200:U:U \
DS:freq:GAUGE:1200:U:U \
DS:disp:GAUGE:1200:U:U \
+ DS:jitter:GAUGE:1200:U:U \
RRA:LAST:0.5:1:312 \
RRA:LAST:0.5:12:2304
#end
mv $1.rrd ../rrd/
-echo $1 >> ../rrd/list-of-systems
+#echo $1 >> ../rrd/list-of-systems
./do-build-index
diff --git a/scripts/do-ntp-rrdstats b/scripts/do-ntp-rrdstats
index 1b3b99b..2c8e97b 100755
--- a/scripts/do-ntp-rrdstats
+++ b/scripts/do-ntp-rrdstats
@@ -12,16 +12,14 @@ NSJIT=`grep sys_jitter /tmp/ntp-rrdstats.$$ | awk 'BEGIN{FS="="}{print $2}'`
NCJIT=`grep clk_jitter /tmp/ntp-rrdstats.$$ | awk 'BEGIN{FS="="}{print $2}'`
NWANDER=`grep clk_wander /tmp/ntp-rrdstats.$$ | awk 'BEGIN{FS="="}{print $2}'`
NDISPER=`grep rootdisp /tmp/ntp-rrdstats.$$ | awk 'BEGIN{FS="="}{print $2}'`
+JITTER=`grep jitter /tmp/ntp-rrdstats.$$ | awk 'BEGIN{FS="="}{print $2}'`
-#echo ${NOFFSET} ${NSJIT} ${NCJIT} ${NWANDER} ${NFREQ} ${NDISPER}
-#exit
-
# keep this in the same order as do-newntpstat creates them, please.
/usr/local/bin/rrdtool update \
$1.rrd \
- N:${NOFFSET}:${NSJIT}:${NCJIT}:${NWANDER}:${NFREQ}:${NDISPER}
+ N:${NOFFSET}:${NSJIT}:${NCJIT}:${NWANDER}:${NFREQ}:${NDISPER}:${JITTER}
rm /tmp/ntp-rrdstats.$$
diff --git a/scripts/do-xntp b/scripts/do-xntp
index f3ebe99..4ebdc1b 100755
--- a/scripts/do-xntp
+++ b/scripts/do-xntp
@@ -56,7 +56,7 @@ ${RRD_BIN}/rrdtool graph \
--title "`TZ=UTC date`" \
--start -93600 \
DEF:wander=${RRDPAGE}/${X}.rrd:wander:LAST \
- LINE1:wander#0000FF:"wander" \
+ LINE1:wander#0000FF:"Wander" \
GPRINT:wander:LAST:%le
${RRD_BIN}/rrdtool graph \
@@ -67,7 +67,7 @@ ${RRD_BIN}/rrdtool graph \
--title "`TZ=UTC date`" \
--start -93600 \
DEF:freq=${RRDPAGE}/${X}.rrd:freq:LAST \
- LINE1:freq#0000FF:"frequency (ppm)" \
+ LINE1:freq#0000FF:"Frequency (ppm)" \
GPRINT:freq:LAST:%lf
${RRD_BIN}/rrdtool graph \
@@ -79,9 +79,21 @@ ${RRD_BIN}/rrdtool graph \
--start -93600 \
DEF:disp=${RRDPAGE}/${X}.rrd:disp:LAST \
CDEF:ndisp=disp,1000,/ \
- LINE1:ndisp#0000FF:"dispersion" \
+ LINE1:ndisp#0000FF:"Dispersion" \
GPRINT:ndisp:LAST:%lf
+${RRD_BIN}/rrdtool graph \
+ --imgformat PNG ${RRDPAGE}/${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 \
+ CDEF:ndisp=disp,1000,/ \
+ LINE1:ndisp#0000FF:"Jitter" \
+ GPRINT:ndisp:LAST:%lf
+
# fat (weekly) graphs
@@ -148,6 +160,18 @@ ${RRD_BIN}/rrdtool graph \
LINE1:ndisp#0000FF:"dispersion" \
GPRINT:ndisp:LAST:%lf
+${RRD_BIN}/rrdtool graph \
+ --imgformat PNG ${RRDPAGE}/${X}-week-ntp-jitter.png \
+ --width 600 --height 200 \
+ --alt-autoscale \
+ --vertical-label "${X}" \
+ --title "`TZ=UTC date`" \
+ --start -691200 \
+ DEF:disp=${RRDPAGE}/${X}.rrd:jitter:LAST \
+ CDEF:ndisp=disp,1000,/ \
+ LINE1:ndisp#0000FF:"Jitter" \
+ GPRINT:ndisp:LAST:%lf
+
done
#end
diff --git a/scripts/templates/template b/scripts/templates/template
index 621f3d6..01137fd 100644
--- a/scripts/templates/template
+++ b/scripts/templates/template
@@ -1,29 +1,5 @@
<p>
-<h2>Host POOL, Daily Status</h2>
+<h2>Host: POOL</h2>
<p>
-<img src="/rrd/POOL-ntp-offset.png">
-<br />
-<img src="/rrd/POOL-ntp-freq.png">
-<br />
-<img src="/rrd/POOL-ntp-sysjit.png">
-<br />
-<img src="/rrd/POOL-ntp-clkjit.png">
-<br />
-<img src="/rrd/POOL-ntp-wander.png">
-<br />
-<img src="/rrd/POOL-ntp-disp.png">
-<br />
-<h2>Host POOL, Weekly Status</h2>
-<br />
-<img src="/rrd/POOL-week-ntp-offset.png">
-<br />
-<img src="/rrd/POOL-week-ntp-freq.png">
-<br />
-<img src="/rrd/POOL-week-ntp-sysjit.png">
-<br />
-<img src="/rrd/POOL-week-ntp-clkjit.png">
-<br />
-<img src="/rrd/POOL-week-ntp-wander.png">
-<br />
-<img src="/rrd/POOL-week-ntp-disp.png">
+<a href="POOL.html"><img src="/rrd/POOL-ntp-offset.png"></a>
</p>