]> git.openstreetmap.org Git - chef.git/blob - cookbooks/munin/files/default/plugins/mod_tile_response
Add warning thresholds for postgres replication delay
[chef.git] / cookbooks / munin / files / default / plugins / mod_tile_response
1 #!/bin/sh
2 #
3 # Plugin to monitor the response codes of tiles returned by mod_tile
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 mod_tile HTTP response codes'
14         echo 'graph_args --base 1000 -l 0'
15         echo 'graph_vlabel responses per ${graph_period}'
16         echo 'graph_category mod_tile'
17         echo 'response200.label 200 OK'
18         echo 'response200.draw AREA'
19         echo 'response200.type DERIVE'
20         echo 'response200.min 0'
21         echo 'response304.label 304 Not Modified'
22         echo 'response304.draw STACK'
23         echo 'response304.type DERIVE'
24         echo 'response304.min 0'
25         echo 'response404.label 404 Not Found'
26         echo 'response404.draw STACK'
27         echo 'response404.type DERIVE'
28         echo 'response404.min 0'
29         echo 'response500.label 500 Internal Error'
30         echo 'response500.draw STACK'
31         echo 'response500.type DERIVE'
32         echo 'response500.min 0'
33
34         exit 0
35 fi
36
37
38 data=`wget -q http://localhost/mod_tile -O -`
39
40 ok_resp=`expr match "$data" '.*NoResp200: \([0-9]*\)'`
41 nm_resp=`expr match "$data" '.*NoResp304: \([0-9]*\)'`
42 fnf_resp=`expr match "$data" '.*NoResp404: \([0-9]*\)'`
43 error_resp=`expr match "$data" '.*NoResp5XX: \([0-9]*\)'`
44
45 echo "response200.value " $ok_resp
46 echo "response304.value " $nm_resp
47 echo "response404.value " $fnf_resp
48 echo "response500.value " $error_resp