From a47f377c520d8d577741fe34012678063e25661a Mon Sep 17 00:00:00 2001 From: Matt Rude Date: Sun, 19 Jun 2011 00:41:42 -0500 Subject: more status updates --- scripts/do-newntpstat | 57 +++++++++++++++++++------ scripts/do-ntp-rrdstats | 7 +--- scripts/do-xntp | 86 ++++++++++++++++++++------------------ scripts/templates/template | 4 +- scripts/templates/template-by-type | 16 +++++-- scripts/templates/template-host | 32 +++++++------- 6 files changed, 121 insertions(+), 81 deletions(-) (limited to 'scripts') diff --git a/scripts/do-newntpstat b/scripts/do-newntpstat index 1d074b8..dda3729 100755 --- a/scripts/do-newntpstat +++ b/scripts/do-newntpstat @@ -9,19 +9,50 @@ RRD_BIN=/usr/bin # 26 hours and 8 days data bins -${RRD_BIN}/rrdtool create $1.rrd \ - DS:offset:GAUGE:1200:U:U \ - DS:sjit:GAUGE:1200:U:U \ - DS:cjit:GAUGE:1200:U:U \ - 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 +${RRD_BIN}/rrdtool create ../rrd/$1.rrd --step 300 \ + DS:offset:GAUGE:300:U:U \ + DS:sjit:GAUGE:300:U:U \ + DS:cjit:GAUGE:300:U:U \ + DS:wander:GAUGE:300:U:U \ + DS:freq:GAUGE:300:U:U \ + DS:disp:GAUGE:300:U:U \ + DS:jitter:GAUGE:300:U:U \ + RRA:LAST:0.5:1:300 \ + RRA:LAST:0.5:6:700 \ + RRA:LAST:0.5:24:775 \ + RRA:LAST:0.5:288:797 \ + RRA:AVERAGE:0.5:1:300 \ + RRA:AVERAGE:0.5:6:700 \ + RRA:AVERAGE:0.5:24:775 \ + RRA:AVERAGE:0.5:288:797 \ + RRA:MAX:0.5:1:300 \ + RRA:MAX:0.5:6:700 \ + RRA:MAX:0.5:24:775 \ + RRA:MAX:0.5:288:797 \ + RRA:MIN:0.5:1:300 \ + RRA:MIN:0.5:6:700 \ + RRA:MIN:0.5:24:775 \ + RRA:MIN:0.5:288:797 -#end +${RRD_BIN}/rrdtool create ../rrd/$1-clients.rrd --step 300 \ + DS:clients:GAUGE:300:0:50000 \ + DS:abusive:GAUGE:300:0:50000 \ + RRA:LAST:0.5:1:300 \ + RRA:LAST:0.5:6:700 \ + RRA:LAST:0.5:24:775 \ + RRA:LAST:0.5:288:797 \ + RRA:AVERAGE:0.5:1:300 \ + RRA:AVERAGE:0.5:6:700 \ + RRA:AVERAGE:0.5:24:775 \ + RRA:AVERAGE:0.5:288:797 \ + RRA:MAX:0.5:1:300 \ + RRA:MAX:0.5:6:700 \ + RRA:MAX:0.5:24:775 \ + RRA:MAX:0.5:288:797 \ + RRA:MIN:0.5:1:300 \ + RRA:MIN:0.5:6:700 \ + RRA:MIN:0.5:24:775 \ + RRA:MIN:0.5:288:797 -mv $1.rrd ../rrd/ echo $1 >> ../rrd/list-of-systems -./do-build-index +./do-build-site diff --git a/scripts/do-ntp-rrdstats b/scripts/do-ntp-rrdstats index 0c2b90d..4492aff 100755 --- a/scripts/do-ntp-rrdstats +++ b/scripts/do-ntp-rrdstats @@ -14,13 +14,8 @@ 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}'` - # keep this in the same order as do-newntpstat creates them, please. - /usr/bin/rrdtool update \ - $1.rrd \ - N:${NOFFSET}:${NSJIT}:${NCJIT}:${NWANDER}:${NFREQ}:${NDISPER}:${JITTER} + $1.rrd N:${NOFFSET}:${NSJIT}:${NCJIT}:${NWANDER}:${NFREQ}:${NDISPER}:0 rm /tmp/ntp-rrdstats.$$ - -#end diff --git a/scripts/do-xntp b/scripts/do-xntp index 5b3b4c2..67ec9b5 100755 --- a/scripts/do-xntp +++ b/scripts/do-xntp @@ -5,16 +5,14 @@ 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/kirby-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 +#rsync -a ${RRDPAGE}/twyla.mattrude.com-clients.rrd twyla:${RRDPAGE}/twyla-client.rrd +#rsync -a ${RRDPAGE}/samantha.mattrude.com-clients.rrd samantha:${RRDPAGE}/samantha-client.rrd +${RRD_BIN}/rrdupdate ${RRDPAGE}/kirby.mattrude.com-clients.rrd N:`${SCRIPTS}/do-ntp-client-update` +rsync -a twyla:${RRDPAGE}/twyla-client.rrd ${RRDPAGE}/twyla.mattrude.com-clients.rrd +rsync -a samantha:${RRDPAGE}/samantha-client.rrd ${RRDPAGE}/samantha.mattrude.com-clients.rrd +sleep 1 cd ${RRDPAGE} - if [ ! $? ]; then exit 1; fi for X in `cat list-of-systems` @@ -23,21 +21,21 @@ do if [ ! $? ]; then exit 1; fi ${RRD_BIN}/rrdtool graph --imgformat=PNG ${STATUS}/${X}/daily-ntp-clients-small.png \ - --width=290 --height=100 --start=-86400 --end=-300 \ - --title='Kirby - 174.143.169.159' \ + --width=296 --height=111 --start=-86400 --end=-300 \ + --title="${X}" \ --vertical-label='Active Clients' \ - DEF:a="/var/www/time.mattrude.com/rrd/kirby.mattrude.com-clients.rrd":clients:AVERAGE \ + DEF:a="${RRDPAGE}/${X}-clients.rrd":clients:LAST \ 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" > /dev/null ${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/daily-ntp-clients.png \ - --width=600 --height=200 --start=-86400 \ + --width=650 --height=200 --start=-86400 \ --title="${X} - Number of Active Clients" \ --vertical-label='Number of Clients' \ - 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 \ + DEF:a="${RRDPAGE}/${X}-clients.rrd":clients:LAST \ + DEF:b="${RRDPAGE}/${X}-clients.rrd":abusive:LAST \ AREA:a#002A97FF:"Clients:" \ GPRINT:a:LAST:"Current\:%8.2lf %s" \ GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \ @@ -48,11 +46,11 @@ do GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" > /dev/null ${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/weekly-ntp-clients.png \ - --width=600 --height=200 --start=-691200 \ + --width=650 --height=200 --start=-691200 \ --title="${X} - Number of Active Clients" \ --vertical-label='Number of Clients' \ - 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 \ + DEF:a="${RRDPAGE}/${X}-clients.rrd":clients:LAST \ + DEF:b="${RRDPAGE}/${X}-clients.rrd":abusive:LAST \ AREA:a#002A97FF:"Clients:" \ GPRINT:a:LAST:"Current\:%8.2lf %s" \ GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \ @@ -63,11 +61,11 @@ do GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" > /dev/null ${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/monthly-ntp-clients.png \ - --width=600 --height=200 --start=-2629744 \ + --width=650 --height=200 --start=-2629744 \ --title="${X} - Number of Active Clients" \ --vertical-label='Number of Clients' \ - 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 \ + DEF:a="${RRDPAGE}/${X}-clients.rrd":clients:LAST \ + DEF:b="${RRDPAGE}/${X}-clients.rrd":abusive:LAST \ AREA:a#002A97FF:"Clients:" \ GPRINT:a:LAST:"Current\:%8.2lf %s" \ GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \ @@ -78,11 +76,11 @@ do GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" > /dev/null ${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/yearly-ntp-clients.png \ - --width=600 --height=200 --start=-31556926 \ + --width=650 --height=200 --start=-31556926 \ --title="${X} - Number of Active Clients" \ - --vertical-label='Number of Clients' \ - 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 \ + --vertical-label='${X}' \ + DEF:a="${RRDPAGE}/${X}-clients.rrd":clients:LAST \ + DEF:b="${RRDPAGE}/${X}-clients.rrd":abusive:LAST \ AREA:a#002A97FF:"Clients:" \ GPRINT:a:LAST:"Current\:%8.2lf %s" \ GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \ @@ -95,46 +93,53 @@ do for a in offset sjit cjit wander freq disp jitter do ${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/daily-ntp-${a}.png \ - --width 600 --height 200 --start -86400 \ - --title "`TZ=UTC date`" \ + --width 650 --height 200 --start -86400 \ + --title "${X} - ${a} - Daily - `date`" \ --vertical-label "${X}" \ - DEF:${a}=${RRDPAGE}/${X}.rrd:${a}:LAST \ - CDEF:n${a}=${a},1000,/ \ - AREA:n${a}#002A97FF:"${a}" \ - GPRINT:n${a}:LAST:%le > /dev/null + DEF:a="${RRDPAGE}/${X}.rrd":${a}:LAST \ + AREA:a#002A97FF:"${a}:" \ + GPRINT:a:LAST:" Current\:%8.2lf %s" \ + GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \ + GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" > /dev/null ${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/weekly-ntp-${a}.png \ - --width 600 --height 200 --start -691200 \ + --width 650 --height 200 --start -691200 \ --title "`TZ=UTC date`" \ --vertical-label "${X}" \ DEF:${a}=${RRDPAGE}/${X}.rrd:${a}:LAST \ CDEF:n${a}=${a},1000,/ \ - AREA:n${a}#002A97FF:"${a}" \ - GPRINT:n${a}:LAST:%le > /dev/null + AREA:n${a}#002A97FF:"${a}:" \ + GPRINT:n${a}:LAST:"Current\:%le" \ + GPRINT:n${a}:AVERAGE:"Average\:%8.2lf %s" \ + GPRINT:n${a}:MAX:"Maximum\:%8.2lf %s\n" > /dev/null ${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/monthly-ntp-${a}.png \ - --width 600 --height 200 --start -2629744 \ + --width 650 --height 200 --start -2629744 \ --title "`TZ=UTC date`" \ --vertical-label "${X}" \ DEF:${a}=${RRDPAGE}/${X}.rrd:${a}:LAST \ CDEF:n${a}=${a},1000,/ \ - AREA:n${a}#002A97FF:"${a}" \ - GPRINT:n${a}:LAST:%le > /dev/null + AREA:n${a}#002A97FF:"${a}:" \ + GPRINT:n${a}:LAST:"Current\:%le" \ + GPRINT:n${a}:AVERAGE:"Average\:%8.2lf %s" \ + GPRINT:n${a}:MAX:"Maximum\:%8.2lf %s\n" > /dev/null ${RRD_BIN}/rrdtool graph --imgformat PNG ${STATUS}/${X}/yearly-ntp-${a}.png \ - --width 600 --height 200 --start -31556926 \ + --width 650 --height 200 --start -31556926 \ --title "`TZ=UTC date`" \ --vertical-label "${X}" \ DEF:${a}=${RRDPAGE}/${X}.rrd:${a}:LAST \ CDEF:n${a}=${a},1000,/ \ - AREA:n${a}#002A97FF:"${a}" \ - GPRINT:n${a}:LAST:%le > /dev/null + AREA:n${a}#002A97FF:"${a}:" \ + GPRINT:n${a}:LAST:"Current\:%le" \ + GPRINT:n${a}:AVERAGE:"Average\:%8.2lf %s" \ + GPRINT:n${a}:MAX:"Maximum\:%8.2lf %s\n" > /dev/null done done ${RRD_BIN}/rrdtool graph --imgformat=PNG ${STATUS}/all-clients.png \ - --width=290 --height=72 --start=-86400 \ + --width=296 --height=83 --start=-86400 \ --title='Active Clients on All Servers' \ --vertical-label='Active Clients' \ DEF:a="/var/www/time.mattrude.com/rrd/kirby.mattrude.com-clients.rrd":clients:AVERAGE \ @@ -154,6 +159,5 @@ ${RRD_BIN}/rrdtool graph --imgformat=PNG ${STATUS}/all-clients.png \ GPRINT:c:MAX:"Max\:%6.2lf %s\n" > /dev/null rm -f /var/www/time.mattrude.com/logs/ntp-stats-samantha.log /var/www/time.mattrude.com/logs/ntp-stats-twyla.log - ssh samantha /home/matt/bin/ntp/ntp_clients_stats > /var/www/time.mattrude.com/logs/ntp-stats-samantha.log ssh twyla /home/matt/bin/ntp/ntp_clients_stats > /var/www/time.mattrude.com/logs/ntp-stats-twyla.log diff --git a/scripts/templates/template b/scripts/templates/template index 86ea922..4bcef99 100644 --- a/scripts/templates/template +++ b/scripts/templates/template @@ -1,2 +1,4 @@

Time Server: POOL

-

+
+

+
diff --git a/scripts/templates/template-by-type b/scripts/templates/template-by-type index 2d28cb1..5e4dcab 100644 --- a/scripts/templates/template-by-type +++ b/scripts/templates/template-by-type @@ -13,14 +13,22 @@

time.mattrude.com / status / POOL / TYPE

Host POOL, TYPE Daily Status

-

+
+

+

Host POOL, TYPE Weekly Status

-

+
+

+

Host POOL, TYPE Monthly Status

-

+
+

+

Host POOL, TYPE Yearly Status

-

+
+

+

diff --git a/scripts/templates/template-host b/scripts/templates/template-host index adac229..68aa513 100644 --- a/scripts/templates/template-host +++ b/scripts/templates/template-host @@ -13,23 +13,23 @@

time.mattrude.com / status / POOL

Legend

-clients		The Number of active clients
+clients		number of active clients
+abusive		number of active abusive clients
 offset          combined time offset
-jitter		or dispersion
-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
+freq            clock frequency offset (PPM)
+sjit            combined system jitter
+cjit            clock jitter
+wander          clock frequency wander (PPM)
+disp            total dispersion to the primary reference clock
 

Host POOL, Daily Status

-

-

-

-

-

-

-

-

-
+
+

+

+

+

+

+

+

+
-- cgit v1.2.3-59-ga6da