aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMatt Rude <[email protected]>2011-06-25 21:04:36 -0500
committerMatt Rude <[email protected]>2011-06-25 21:04:36 -0500
commit3cf03bc067a8e445b9251fc8b6692bc81332f2a6 (patch)
tree8883d500da258bff9fee05db0152e579a8dbd116 /scripts
parent8d4fee5c26adf84fe813666a5dc0631b337a3e8d (diff)
downloadtime.mattrude.com-3cf03bc067a8e445b9251fc8b6692bc81332f2a6.tar.gz
time.mattrude.com-3cf03bc067a8e445b9251fc8b6692bc81332f2a6.tar.bz2
time.mattrude.com-3cf03bc067a8e445b9251fc8b6692bc81332f2a6.zip
more script updates
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/do-newntpstat23
-rwxr-xr-xscripts/do-rrd-update13
2 files changed, 13 insertions, 23 deletions
diff --git a/scripts/do-newntpstat b/scripts/do-newntpstat
index 04ea5ef..3bc9eda 100755
--- a/scripts/do-newntpstat
+++ b/scripts/do-newntpstat
@@ -16,7 +16,8 @@ ${RRD_BIN}/rrdtool create ../rrd/$1.rrd --step 300 \
DS:wander:GAUGE:600:U:U \
DS:freq:GAUGE:600:U:U \
DS:disp:GAUGE:600:U:U \
- DS:jitter:GAUGE:600:U:U \
+ DS:clients:GAUGE:600:U:U \
+ DS:abusive:GAUGE:600:U:U \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
@@ -34,25 +35,5 @@ ${RRD_BIN}/rrdtool create ../rrd/$1.rrd --step 300 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797
-${RRD_BIN}/rrdtool create ../rrd/$1-clients.rrd --step 300 \
- DS:clients:GAUGE:600:0:50000 \
- DS:abusive:GAUGE:600:0:50000 \
- RRA:LAST:0.5:1:600 \
- RRA:LAST:0.5:6:700 \
- RRA:LAST:0.5:24:775 \
- RRA:LAST:0.5:288:797 \
- RRA:AVERAGE:0.5:1:600 \
- RRA:AVERAGE:0.5:6:700 \
- RRA:AVERAGE:0.5:24:775 \
- RRA:AVERAGE:0.5:288:797 \
- RRA:MAX:0.5:1:600 \
- RRA:MAX:0.5:6:700 \
- RRA:MAX:0.5:24:775 \
- RRA:MAX:0.5:288:797 \
- RRA:MIN:0.5:1:600 \
- RRA:MIN:0.5:6:700 \
- RRA:MIN:0.5:24:775 \
- RRA:MIN:0.5:288:797
-
echo $1 >> ../rrd/list-of-systems
./do-build-site
diff --git a/scripts/do-rrd-update b/scripts/do-rrd-update
index c48344e..ddadfc3 100755
--- a/scripts/do-rrd-update
+++ b/scripts/do-rrd-update
@@ -1,6 +1,7 @@
#!/bin/sh
DATE=`date +%Y-%m-%d' '%T`
+SCRIPTS=/var/www/time.mattrude.com/scripts
case "$1" in
"") echo "Missing system name."; exit 1
esac
@@ -13,6 +14,12 @@ if [ ! -f ntpclients.sqlite ]; then
echo "CREATE TABLE clientss (date datetime NOT NULL, host varchar(255) NOT NULL, value blob);" |sqlite3 ntpclients.sqlite
fi
+if [ $1 == "localhost" ]; then
+ CLIENTS=`${SCRIPTS}/do-ntp-client-update`
+else
+ CLIENTS='0:0'
+fi
+
/usr/sbin/ntpq -4 -c rv $1 | awk 'BEGIN{ RS=","}{ print }' >> /tmp/ntp-rrdstats.$$
NOFFSET=`grep offset /tmp/ntp-rrdstats.$$ | awk 'BEGIN{FS="="}{print $2}'`
@@ -23,8 +30,10 @@ 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}:0
rm /tmp/ntp-rrdstats.$$
+# 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}:${CLIENTS}
+echo "N:${NOFFSET}:${NSJIT}:${NCJIT}:${NWANDER}:${NFREQ}:${NDISPER}:${CLIENTS}"
+
echo "INSERT INTO status (date, host, offset, freq, sjit, cjit, wander, disp) VALUES ('${DATE}', '${1}', '${NOFFSET}', '${NSJIT}', '${NCJIT}', '${NWANDER}', '${NFREQ}', '${NDISPER}');" |sqlite3 ntpstatus.sqlite