File: mod_tile_response

package info (click to toggle)
libapache2-mod-tile 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,872 kB
  • sloc: cpp: 18,151; ansic: 7,574; sh: 980; makefile: 163; xml: 27
file content (61 lines) | stat: -rwxr-xr-x 2,062 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
#
# Plugin to monitor the response codes of tiles returned by mod_tile
#
# Parameters:
#
# 	config   (required)
# 	autoconf (optional - used by munin-config)
#
# Copyright (c) 2007 - 2023 by mod_tile contributors (see AUTHORS file)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; If not, see http://www.gnu.org/licenses/.

if [ "$1" = "config" ]; then

  echo 'graph_title mod_tile HTTP response codes'
  echo 'graph_args --base 1000 -l 0'
  echo 'graph_vlabel responses per ${graph_period}'
  echo 'graph_category mod_tile'
  echo 'response200.label 200 OK'
  echo 'response200.draw AREA'
  echo 'response200.type DERIVE'
  echo 'response200.min 0'
  echo 'response304.label 304 Not Modified'
  echo 'response304.draw STACK'
  echo 'response304.type DERIVE'
  echo 'response304.min 0'
  echo 'response404.label 404 Not Found'
  echo 'response404.draw STACK'
  echo 'response404.type DERIVE'
  echo 'response404.min 0'
  echo 'response500.label 500 Internal Error'
  echo 'response500.draw STACK'
  echo 'response500.type DERIVE'
  echo 'response500.min 0'

  exit 0
fi

data=$(wget -q ${MOD_TILE_URL:-http://localhost/mod_tile} -O -)

ok_resp=$(expr match "$data" '.*NoResp200: \([0-9]*\)')
nm_resp=$(expr match "$data" '.*NoResp304: \([0-9]*\)')
fnf_resp=$(expr match "$data" '.*NoResp404: \([0-9]*\)')
error_resp=$(expr match "$data" '.*NoResp5XX: \([0-9]*\)')

echo "response200.value " $ok_resp
echo "response304.value " $nm_resp
echo "response404.value " $fnf_resp
echo "response500.value " $error_resp