]> git.openstreetmap.org Git - nominatim.git/commitdiff
bulk ip watch
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 14 Dec 2012 22:37:10 +0000 (23:37 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 14 Dec 2012 22:37:10 +0000 (23:37 +0100)
munin/nominatim_throttled_ips [new file with mode: 0755]

diff --git a/munin/nominatim_throttled_ips b/munin/nominatim_throttled_ips
new file mode 100755 (executable)
index 0000000..b2f28e5
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Plugin to monitor the number of IPs in special pools
+#
+# Parameters: 
+#
+#       config   (required)
+#       autoconf (optional - used by munin-config)
+#
+if [ "$1" = "config" ]; then
+        echo 'graph_title Restricted IPs' 
+        echo 'graph_vlabel number of IPs'
+        echo 'graph_category nominatim'
+        echo 'bulk.label bulk'
+        echo 'bulk.draw AREA'
+        echo 'bulk.type GAUGE'
+        echo 'block.label blocked'
+        echo 'block.draw STACK'
+        echo 'block.type GAUGE'
+        exit 0
+fi
+BASEDIR="$(dirname "$(readlink -f "$0")")"
+
+cut -f 2 -d ' ' $BASEDIR/../settings/ip_blocks.map | uniq -c | sed 's:[[:space:]]*\([0-9]\+\) \(.*\):\2.value \1:'