aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authormattrude <[email protected]>2012-06-21 23:29:22 -0500
committermattrude <[email protected]>2012-06-21 23:29:22 -0500
commit22e49196a2af04960b530fc59f76e3b0c20b1bc1 (patch)
tree30fe086d727906859b6cd911166805c30cb93de3 /scripts
parent5ed6e469cfb58c659cec0f894e887fffb4ad1e50 (diff)
downloadtime.mattrude.com-22e49196a2af04960b530fc59f76e3b0c20b1bc1.tar.gz
time.mattrude.com-22e49196a2af04960b530fc59f76e3b0c20b1bc1.tar.bz2
time.mattrude.com-22e49196a2af04960b530fc59f76e3b0c20b1bc1.zip
Bringing up to date
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-site.sh2
-rwxr-xr-xscripts/do-rrd-update19
-rwxr-xr-xscripts/do-xntp2
-rw-r--r--scripts/templates/head2
-rw-r--r--scripts/templates/index-head2
-rw-r--r--scripts/templates/template-by-type2
-rw-r--r--scripts/templates/template-host2
-rw-r--r--scripts/templates/template-host-by-type2
8 files changed, 20 insertions, 13 deletions
diff --git a/scripts/build-site.sh b/scripts/build-site.sh
index 85142af..c5b8331 100755
--- a/scripts/build-site.sh
+++ b/scripts/build-site.sh
@@ -65,7 +65,7 @@ do
do
mkdir -p $POOLPAGE/$X/$a
cat /dev/null > out.template
- sed -e s/POOL/$X/g $TEMPLATESDIR/template-by-type |sed -e s/###TYPE###/$a/g >> out.template
+ sed -e s/POOL/$X/g $TEMPLATESDIR/template-host-by-type |sed -e s/###TYPE###/$a/g >> out.template
sync
cat out.template $TEMPLATESDIR/tail > $X/$a/index.html
rm -f out.template
diff --git a/scripts/do-rrd-update b/scripts/do-rrd-update
index 0ba2e5a..7323934 100755
--- a/scripts/do-rrd-update
+++ b/scripts/do-rrd-update
@@ -20,11 +20,17 @@ fi
# CLIENTS=`ssh ${1} ${SCRIPTS}/do-ntp-client-update`
#fi
-/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`
+ssh $1 /home/matt/bin/ntp/ntp_clients_stats > ../logs/$1.log
+
+CLIENTS=`grep "Estimated active ntp pool clients:" ../logs/$1.log |awk '{ print $6 }'`
+LIMITED=`grep "Estimated abusive ntp pool clients:" ../logs/$1.log |awk '{ print $6 }'`
+#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`
+
+
+/usr/local/sbin/ntpq -4 -c rv $1 | awk 'BEGIN{ RS=","}{ print }' >> /tmp/ntp-rrdstats.$$
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}'`
@@ -39,7 +45,8 @@ rm /tmp/ntp-rrdstats.$$
/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
-echo "select * from status WHERE host = $1 ORDER BY date DESC;" |sqlite3 -separator ',' rrd/ntpstatus.sqlite > $1.csv
+echo "INSERT INTO status (date, host, offset, freq, sjit, cjit, wander, disp, clients, limited, kod) VALUES ('${DATE}', '${1}', '${NOFFSET}', '${NSJIT}', '${NCJIT}', '${NWANDER}', '${NFREQ}', '${NDISPER}', '${CLIENTS}', '${LIMITED}', '${KOD}');" |sqlite3 ntpstatus.sqlite
+
+echo "date, host, offset, freq, sjit, cjit, wander, disp, clients, limited, kod" > $1.csv
+echo "select * from status WHERE host = '"$1"' ORDER BY date DESC;" |sqlite3 -separator ',' ntpstatus.sqlite >> $1.csv
-ssh $1 /home/matt/bin/ntp/ntp_clients_stats > ../logs/$1.log
diff --git a/scripts/do-xntp b/scripts/do-xntp
index 6edf2ad..5a1631e 100755
--- a/scripts/do-xntp
+++ b/scripts/do-xntp
@@ -9,5 +9,5 @@ if [ ! $? ]; then exit 1; fi
for X in `cat list-of-systems`
do
- sh ${SCRIPTS}/do-rrd-update ${X} &
+ sh ${SCRIPTS}/do-rrd-update ${X}
done
diff --git a/scripts/templates/head b/scripts/templates/head
index cc9a067..324fedc 100644
--- a/scripts/templates/head
+++ b/scripts/templates/head
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>time.mattrude.com :: Time Server Status Page</title>
<link rel="stylesheet" type="text/css" href="/style.css"/>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
diff --git a/scripts/templates/index-head b/scripts/templates/index-head
index 5749f54..47908a0 100644
--- a/scripts/templates/index-head
+++ b/scripts/templates/index-head
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>time.mattrude.com :: Time Server Status Page</title>
<link rel="stylesheet" type="text/css" href="/style.css"/>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
diff --git a/scripts/templates/template-by-type b/scripts/templates/template-by-type
index dd25688..f70f024 100644
--- a/scripts/templates/template-by-type
+++ b/scripts/templates/template-by-type
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>time.mattrude.com :: POOL Time Server Status Page</title>
<link rel="stylesheet" type="text/css" href="/style.css"/>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
diff --git a/scripts/templates/template-host b/scripts/templates/template-host
index 255ef77..0928d55 100644
--- a/scripts/templates/template-host
+++ b/scripts/templates/template-host
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>time.mattrude.com :: POOL Time Server Status Page</title>
<link rel="stylesheet" type="text/css" href="/style.css"/>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
diff --git a/scripts/templates/template-host-by-type b/scripts/templates/template-host-by-type
index 0a8a28b..26d5b29 100644
--- a/scripts/templates/template-host-by-type
+++ b/scripts/templates/template-host-by-type
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>time.mattrude.com :: POOL:###TYPE### Time Server Status Page</title>
<link rel="stylesheet" type="text/css" href="/style.css"/>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />