From 015c6fa0cd03fccfb6403c4a1044b9d1b40da8e0 Mon Sep 17 00:00:00 2001 From: Matt Rude Date: Sun, 5 Jun 2011 21:41:26 -0500 Subject: more small updates --- scripts/build_graph.cgi | 18 +++---- scripts/do-build-graphs | 23 ++++++++ scripts/do-build-site | 9 ++-- scripts/do-xntp | 116 ++++++++++++++++++++++++++++++---------- scripts/index.html | 5 -- scripts/templates/index-head | 31 +++-------- scripts/templates/index-tail | 5 ++ scripts/templates/template | 4 +- scripts/templates/template-host | 28 ++++++++++ 9 files changed, 168 insertions(+), 71 deletions(-) delete mode 100644 scripts/index.html (limited to 'scripts') 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 "

NTP Hosts

+echo "

Time Server Hosts

" >> 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 @@ - - - - - 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 @@ - Time Server Status - + time.mattrude.com :: Time Server Status Page + -experimental ntp tech info -

-NTP Status Page -

-

-Legends (taken from - -http://www.eecis.udel.edu/~mills/ntp/html/ntpq.html): -
-

-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
-
-
-

- - +

+
+
+

Time Server Status Page

+
+

/ time.mattrude.com / status /

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 @@

+

+ +
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 @@

-

Host: POOL

+

Time Server: POOL

- +

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 @@ + + time.mattrude.com :: POOL Time Server Status Page + + + + + +
+
+
+

POOL NTP Status Page

+
+

/ time.mattrude.com / status / POOL

+

+Legends (taken from + +http://www.eecis.udel.edu/~mills/ntp/html/ntpq.html): +

+
+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
+
+
+

Host POOL, Daily Status

-- cgit v1.2.3-59-ga6da