aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Rude <[email protected]>2011-11-19 19:51:11 -0600
committerMatt Rude <[email protected]>2011-11-19 19:51:11 -0600
commitda4255f0dbc3b7a565ff4828761f24b4db014925 (patch)
tree61a0f8a191810b5def31ab7cc0ee94586a0c0fca
parentbc363293f13b87f5608d71b072916b38a4d95774 (diff)
downloadtime.mattrude.com-da4255f0dbc3b7a565ff4828761f24b4db014925.tar.gz
time.mattrude.com-da4255f0dbc3b7a565ff4828761f24b4db014925.tar.bz2
time.mattrude.com-da4255f0dbc3b7a565ff4828761f24b4db014925.zip
Starting to use the new mrumon
-rw-r--r--index.html13
-rwxr-xr-xscripts/do-rrd-update19
-rwxr-xr-xscripts/templates/graphs.cgi18
3 files changed, 36 insertions, 14 deletions
diff --git a/index.html b/index.html
index 25aca1a..6d65bc1 100644
--- a/index.html
+++ b/index.html
@@ -6,6 +6,19 @@
<title>Matt's Time Server</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
+ <script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-9532791-6']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ </script>
</head>
<body>
<div id="content">
diff --git a/scripts/do-rrd-update b/scripts/do-rrd-update
index 93ea7c6..7279a5e 100755
--- a/scripts/do-rrd-update
+++ b/scripts/do-rrd-update
@@ -14,14 +14,17 @@ fi
# echo "CREATE TABLE clientss (date datetime NOT NULL, host varchar(255) NOT NULL, value blob);" |sqlite3 ntpclients.sqlite
#fi
-if [ $1 == `hostname` ]; then
- CLIENTS=`${SCRIPTS}/do-ntp-client-update`
-else
- CLIENTS=`ssh ${1} ${SCRIPTS}/do-ntp-client-update`
-fi
+#if [ $1 == `hostname` ]; then
+# CLIENTS=`${SCRIPTS}/do-ntp-client-update`
+#else
+# CLIENTS=`ssh ${1} ${SCRIPTS}/do-ntp-client-update`
+#fi
-/usr/sbin/ntpq -4 -c rv $1 | awk 'BEGIN{ RS=","}{ print }' >> /tmp/ntp-rrdstats.$$
+/usr/local/sbin/ntpq -4 -c rv $1 | awk 'BEGIN{ RS=","}{ print }' >> /tmp/ntp-rrdstats.$$
+CLIENTS=`/usr/local/sbin/ntpq -n -c mrulist ${1} 2> /dev/null |grep -v '===' |grep -v 'lstint' |wc -l`
+LIMITED=`/usr/local/sbin/ntpq -n -c "mrulist limited" ${1} 2> /dev/null |grep -v '===' |grep -v 'lstint' |wc -l`
+KOD=`/usr/local/sbin/ntpq -n -c "mrulist sort=-avgint kod" ${1} 2> /dev/null |grep -v '===' |grep -v 'lstint' |wc -l`
NOFFSET=`grep offset /tmp/ntp-rrdstats.$$ | awk 'BEGIN{FS="="}{print $2}'`
NFREQ=`grep frequency /tmp/ntp-rrdstats.$$ | awk 'BEGIN{FS="="}{print $2}'`
NSJIT=`grep sys_jitter /tmp/ntp-rrdstats.$$ | awk 'BEGIN{FS="="}{print $2}'`
@@ -33,7 +36,7 @@ JITTER=`grep jitter /tmp/ntp-rrdstats.$$ | awk 'BEGIN{FS="="}{print $2}'`
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}"
+/usr/bin/rrdtool update $1.rrd N:${NOFFSET}:${NSJIT}:${NCJIT}:${NWANDER}:${NFREQ}:${NDISPER}:${CLIENTS}:${LIMITED}:${KOD}
+#echo "N:${NOFFSET}:${NSJIT}:${NCJIT}:${NWANDER}:${NFREQ}:${NDISPER}:${CLIENTS}:${LIMITED}:${KOD}"
echo "INSERT INTO status (date, host, offset, freq, sjit, cjit, wander, disp) VALUES ('${DATE}', '${1}', '${NOFFSET}', '${NSJIT}', '${NCJIT}', '${NWANDER}', '${NFREQ}', '${NDISPER}');" |sqlite3 ntpstatus.sqlite
diff --git a/scripts/templates/graphs.cgi b/scripts/templates/graphs.cgi
index efda9b2..9486ba0 100755
--- a/scripts/templates/graphs.cgi
+++ b/scripts/templates/graphs.cgi
@@ -122,17 +122,23 @@ sub graph_clients($$) {
my $step = $range*$points_per_sample/$xpoints;
rrd_graph($range, $file, $ypoints,
"DEF:clients=$rrd:clients:LAST",
- "DEF:abusive=$rrd:abusive:LAST",
+ "DEF:limited=$rrd:limited:LAST",
+ "DEF:kod=$rrd:kod:LAST",
'AREA:clients#002A97FF:Clients:',
'GPRINT:clients:LAST:Current\:%8.2lf %s',
'GPRINT:clients:AVERAGE:Average\:%8.2lf %s',
'GPRINT:clients:MIN:Minimum\:%8.2lf %s',
'GPRINT:clients:MAX:Maximum\:%8.2lf %s\n',
- 'AREA:abusive#F51D30FF:Abusive:',
- 'GPRINT:abusive:LAST:Current\:%8.2lf %s',
- 'GPRINT:abusive:AVERAGE:Average\:%8.2lf %s',
- 'GPRINT:abusive:MIN:Minimum\:%8.2lf %s',
- 'GPRINT:abusive:MAX:Maximum\:%8.2lf %s\n',
+ 'AREA:limited#ffff00:Limited:',
+ 'GPRINT:limited:LAST:Current\:%8.2lf %s',
+ 'GPRINT:limited:AVERAGE:Average\:%8.2lf %s',
+ 'GPRINT:limited:MIN:Minimum\:%8.2lf %s',
+ 'GPRINT:limited:MAX:Maximum\:%8.2lf %s\n',
+ 'AREA:kod#F51D30FF: K O D :',
+ 'GPRINT:kod:LAST:Current\:%8.2lf %s',
+ 'GPRINT:kod:AVERAGE:Average\:%8.2lf %s',
+ 'GPRINT:kod:MIN:Minimum\:%8.2lf %s',
+ 'GPRINT:kod:MAX:Maximum\:%8.2lf %s\n',
);
}