| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# Plugin to monitor queue length of tiles submited for rendering in renderd |
| 4 |
# |
| 5 |
# Parameters: |
| 6 |
# |
| 7 |
# config (required) |
| 8 |
# autoconf (optional - used by munin-config) |
| 9 |
# |
| 10 |
# Copyright (c) 2007 - 2023 by mod_tile contributors (see AUTHORS file) |
| 11 |
# |
| 12 |
# This program is free software; you can redistribute it and/or |
| 13 |
# modify it under the terms of the GNU General Public License |
| 14 |
# as published by the Free Software Foundation; either version 2 |
| 15 |
# of the License, or (at your option) any later version. |
| 16 |
# |
| 17 |
# This program is distributed in the hope that it will be useful, |
| 18 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 |
# GNU General Public License for more details. |
| 21 |
# |
| 22 |
# You should have received a copy of the GNU General Public License |
| 23 |
# along with this program; If not, see http://www.gnu.org/licenses/. |
| 24 |
|
| 25 |
if [ "$1" = "config" ]; then |
| 26 |
|
| 27 |
echo 'graph_title Renderd queue length' |
| 28 |
echo 'graph_args --base 1000 -l 0' |
| 29 |
echo 'graph_vlabel metatiles' |
| 30 |
echo 'graph_category renderd' |
| 31 |
echo 'reqPrio.label Priority request Queue' |
| 32 |
echo 'reqPrio.type GAUGE' |
| 33 |
echo 'reqPrio.max 100' |
| 34 |
echo 'req.label Request Queue' |
| 35 |
echo 'req.type GAUGE' |
| 36 |
echo 'req.max 100' |
| 37 |
echo 'reqLow.label Low priority request Queue' |
| 38 |
echo 'reqLow.type GAUGE' |
| 39 |
echo 'reqLow.max 100' |
| 40 |
echo 'dirty.label Dirty Queue' |
| 41 |
echo 'dirty.type GAUGE' |
| 42 |
echo 'dirty.max 1000' |
| 43 |
echo 'reqBulk.label Bulk request Queue' |
| 44 |
echo 'reqBulk.type GAUGE' |
| 45 |
echo 'reqBulk.max 100' |
| 46 |
exit 0 |
| 47 |
fi |
| 48 |
|
| 49 |
reqlength=$(sed -e '/^ReqQueueLength/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats}) |
| 50 |
reqpriolength=$(sed -e '/^ReqPrioQueueLength/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats}) |
| 51 |
reqpriolowlength=$(sed -e '/^ReqLowQueueLength/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats}) |
| 52 |
reqbulklength=$(sed -e '/^ReqBulkQueueLength/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats}) |
| 53 |
dirtlength=$(sed -e '/^DirtQueueLength/!d' -e 's/.*: //' -e q ${RENDERD_STATS:-/run/renderd/renderd.stats}) |
| 54 |
|
| 55 |
echo "reqPrio.value " $reqpriolength |
| 56 |
echo "req.value " $reqlength |
| 57 |
echo "reqLow.value " $reqpriolowlength |
| 58 |
echo "dirty.value " $dirtlength |
| 59 |
echo "reqBulk.value " $reqbulklength |