]> git.openstreetmap.org Git - chef.git/blob - cookbooks/munin/files/default/plugins/mod_tile_fresh
55aef14315799f772fa77554ec5f2b3fc25a23e8
[chef.git] / cookbooks / munin / files / default / plugins / mod_tile_fresh
1 #!/bin/sh
2 #
3 # Plugin to monitor the state / freshness  of the 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 freshness of served tiles'
14         echo 'graph_args --base 1000 -l 0'
15         echo 'graph_vlabel tiles per ${graph_period}'
16         echo 'graph_category mod_tile'
17         echo 'fresh.label Fresh from disk'
18         echo 'fresh.draw AREA'
19         echo 'fresh.type DERIVE'
20         echo 'fresh.min 0'
21         echo 'freshrender.label Freshly rendered'
22         echo 'freshrender.draw STACK'
23         echo 'freshrender.type DERIVE'
24         echo 'freshrender.min 0'
25         echo 'old.label Old from disk'
26         echo 'old.draw STACK'
27         echo 'old.type DERIVE'
28         echo 'old.min 0'
29         echo 'oldrender.label Old tile, attempted render'
30         echo 'oldrender.draw STACK'
31         echo 'oldrender.type DERIVE'
32         echo 'oldrender.min 0'
33
34         exit 0
35 fi
36
37 data=`wget -q http://localhost/mod_tile -O -`
38
39 fresh=`expr match "$data" '.*NoFreshCache: \([0-9]*\)'`
40 freshRender=`expr match "$data" '.*NoFreshRender: \([0-9]*\)'`
41 old=`expr match "$data" '.*NoOldCache: \([0-9]*\)'`
42 oldRender=`expr match "$data" '.*NoOldRender: \([0-9]*\)'`
43
44 echo "fresh.value " $fresh
45 echo "freshrender.value " $freshRender
46 echo "old.value " $old
47 echo "oldrender.value " $oldRender