Nominatim/munin/nominatim_importlag

31 lines
797 B
Plaintext
Raw Normal View History

2012-02-02 01:13:05 +04:00
#!/bin/sh
#
# Plugin to monitor the age of the imported data in the rendering db
#
# Can be configured through libpq environment variables, for example
# PGUSER, PGDATABASE, etc. See man page of psql for more information
#
2012-02-02 01:13:05 +04:00
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
if [ "$1" = "config" ]; then
echo 'graph_title Data import lag'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel minutes'
echo 'graph_category nominatim'
echo 'age.label DB import age'
echo 'age.type GAUGE'
echo 'age.cdef age,60,/'
exit 0
fi
delay=`psql -c "copy (select extract(epoch from timezone('utc', now())-lastimportdate)::int from import_status) to stdout"`
2012-02-02 01:13:05 +04:00
echo "age.value $delay"