]> git.openstreetmap.org Git - nominatim.git/commitdiff
munin graph for the import lag
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 1 Feb 2012 21:13:05 +0000 (21:13 +0000)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 1 Feb 2012 21:13:05 +0000 (21:13 +0000)
munin/nominatim_importlag [new file with mode: 0755]

diff --git a/munin/nominatim_importlag b/munin/nominatim_importlag
new file mode 100755 (executable)
index 0000000..8d69f3c
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Plugin to monitor the age of the imported data in the rendering db
+#
+# 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 -d nominatim -c 'copy (select extract(epoch from now()-lastimportdate)::int from import_status) to stdout'`
+echo "age.value $delay"