3 # Plugin to monitor the age of the imported data in the rendering db
8 # autoconf (optional - used by munin-config)
11 if [ "$1" = "config" ]; then
13 echo 'graph_title Data import lag'
14 echo 'graph_args --base 1000 -l 0'
15 echo 'graph_vlabel minutes'
16 echo 'graph_category renderd'
17 echo 'age.label DB import age'
19 echo 'age.cdef age,60,/'
20 echo 'age.warning :600'
21 echo 'age.critical :3600'
25 state=${state:-/home/jburgess/replicate/state.txt}
26 tstamp=`sed -e '/^timestamp=/!d' -e 's/.*=//' -e 's/Z//' -e 's/T/Z/' -e 's/\\\\//' -e 's/\\\\//' -e q ${state}`
27 tstampsec=`date --date=$tstamp +%s`
31 echo "age.value " `expr $nowsec - $tstampsec`