Munin Plugin to check database lag (how much our database copy lags behind the offici...
[osmrrze.git] / scripts / munin-getdblag.sh
CommitLineData
c75370fe 1#!/bin/bash
2
3LASTDBUPDATE=`cat /var/www/lastdbupdate.txt`
4
5TS2=`date '+%s' "--date=$LASTDBUPDATE"`
6TS1=`date '+%s'`
7
8if [ "$1" = "autoconf" ]; then
9 echo yes
10 exit 0
11fi
12
13if [ "$1" = "config" ]; then
14 echo 'graph_title databaselag'
15 echo 'graph_args --lower-limit 0 '
16 echo 'graph_vlabel Seconds our DB copy is lagging behind the official DB'
17 echo 'graph_category postgresql'
18fi
19
20echo 'dblag.label databaselag'
21echo 'dblag.type GAUGE'
22let "DELAY=TS1-TS2"
23echo "dblag.value $DELAY"
24
This page took 0.046766 seconds and 4 git commands to generate.