From: osm@osm.rrze Date: Sat, 11 Aug 2012 11:56:27 +0000 (+0200) Subject: Munin Plugin to check database lag (how much our database copy lags behind the offici... X-Git-Url: http://git.rrze.uni-erlangen.de/gitweb/?a=commitdiff_plain;h=c75370fed02788f2c56b62a5956b4f0220379fbb;p=osmrrze.git Munin Plugin to check database lag (how much our database copy lags behind the official database) --- diff --git a/scripts/munin-getdblag.sh b/scripts/munin-getdblag.sh new file mode 100755 index 0000000..7e19de1 --- /dev/null +++ b/scripts/munin-getdblag.sh @@ -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" +