Munin Plugin to check database lag (how much our database copy lags behind the offici...
authorosm@osm.rrze <osm@osm.rrze.uni-erlangen.de>
Sat, 11 Aug 2012 11:56:27 +0000 (13:56 +0200)
committerosm@osm.rrze <osm@osm.rrze.uni-erlangen.de>
Sat, 11 Aug 2012 11:56:27 +0000 (13:56 +0200)
scripts/munin-getdblag.sh [new file with mode: 0755]

diff --git a/scripts/munin-getdblag.sh b/scripts/munin-getdblag.sh
new file mode 100755 (executable)
index 0000000..7e19de1
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+LASTDBUPDATE=`cat /var/www/lastdbupdate.txt`
+
+TS2=`date '+%s' "--date=$LASTDBUPDATE"`
+TS1=`date '+%s'`
+
+if [ "$1" = "autoconf" ]; then
+        echo yes
+        exit 0
+fi
+
+if [ "$1" = "config" ]; then
+        echo 'graph_title databaselag'
+        echo 'graph_args --lower-limit 0 '
+        echo 'graph_vlabel Seconds our DB copy is lagging behind the official DB'
+        echo 'graph_category postgresql'
+fi
+
+echo 'dblag.label databaselag'
+echo 'dblag.type GAUGE'
+let "DELAY=TS1-TS2"
+echo "dblag.value $DELAY"
+
This page took 0.089795 seconds and 4 git commands to generate.