Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add some comments to help use munin plugin, add over limit detection

  • Loading branch information...
commit 014f19ec685f83ccda9ec1d9dea7f887ddc5b41c 1 parent 10f3a4d
@rodo rodo authored lonvia committed
Showing with 28 additions and 12 deletions.
  1. +28 −12 munin/nominatim_importlag
View
40 munin/nominatim_importlag
@@ -5,26 +5,42 @@
# Can be configured through libpq environment variables, for example
# PGUSER, PGDATABASE, etc. See man page of psql for more information
#
-# Parameters:
+# To configure munin for a default installation, add these lines to
+# the file /etc/munin/plugin-conf.d/munin-node or in any file in the
+# directory /etc/munin/plugin-conf.d/
+#
+# [nominatim_*]
+# user www-data
+# env.PGUSER www-data
+# env.PGPORT 5432
+# env.PGDATABASE nominatim
+# env.age_warning 21600
+# env.age_critical 86400
+
+# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
-
+
+. $MUNIN_LIBDIR/plugins/plugin.sh
+
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 '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,/'
+ print_warning age
+ print_critical age
exit 0
fi
-
+
delay=`psql -c "copy (select extract(epoch from timezone('utc', now())-lastimportdate)::int from import_status) to stdout"`
-
-
+
+
echo "age.value $delay"
Please sign in to comment.
Something went wrong with that request. Please try again.