From c75370fed02788f2c56b62a5956b4f0220379fbb Mon Sep 17 00:00:00 2001 From: "osm@osm.rrze" Date: Sat, 11 Aug 2012 13:56:27 +0200 Subject: [PATCH] Munin Plugin to check database lag (how much our database copy lags behind the official database) --- scripts/munin-getdblag.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 scripts/munin-getdblag.sh 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" + -- 2.25.1