]> git.openstreetmap.org Git - nominatim.git/blob - munin/nominatim_throttled_ips
add munin scripts that use the query logs
[nominatim.git] / munin / nominatim_throttled_ips
1 #!/bin/sh
2 #
3 # Plugin to monitor the number of IPs in special pools
4 #
5 # Parameters: 
6 #
7 #       config   (required)
8 #       autoconf (optional - used by munin-config)
9 #
10  
11 if [ "$1" = "config" ]; then
12  
13         echo 'graph_title Restricted IPs' 
14         echo 'graph_args -l 0'
15         echo 'graph_vlabel number of IPs'
16         echo 'graph_category nominatim'
17         echo 'bulk.label bulk'
18         echo 'bulk.draw AREA'
19         echo 'bulk.type GAUGE'
20         echo 'block.label blocked'
21         echo 'block.draw STACK'
22         echo 'block.type GAUGE'
23         exit 0
24 fi
25  
26 BASEDIR="$(dirname "$(readlink -f "$0")")"
27
28 cut -f 2 -d ' ' $BASEDIR/../settings/ip_blocks.map | sort | uniq -c | sed 's:[[:space:]]*\([0-9]\+\) \(.*\):\2.value \1:'