3 # Plugin to monitor the age of the imported data in the rendering db
 
   5 # Can be configured through libpq environment variables, for example
 
   6 # PGUSER, PGDATABASE, etc. See man page of psql for more information
 
  11 #       autoconf (optional - used by munin-config)
 
  14 if [ "$1" = "config" ]; then
 
  16         echo 'graph_title Data import lag' 
 
  17         echo 'graph_args --base 1000 -l 0' 
 
  18         echo 'graph_vlabel minutes' 
 
  19         echo 'graph_category nominatim' 
 
  20         echo 'age.label DB import age' 
 
  22         echo 'age.cdef age,60,/'
 
  27 delay=`psql -c "copy (select extract(epoch from timezone('utc', now())-lastimportdate)::int from import_status) to stdout"`
 
  30 echo "age.value $delay"