mirror of
https://github.com/openstreetmap/mod_tile.git
synced 2025-07-25 15:04:30 +00:00
Applied shell code formatting
This commit is contained in:
@ -1,3 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the state / freshness of the tiles returned by mod_tile
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -13,59 +22,48 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the state / freshness of the tiles returned by mod_tile
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo 'graph_title freshness of served tiles'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel tiles per ${graph_period}'
|
||||
echo 'graph_category mod_tile'
|
||||
echo 'fresh.label Fresh from disk'
|
||||
echo 'fresh.draw AREA'
|
||||
echo 'fresh.type DERIVE'
|
||||
echo 'fresh.min 0'
|
||||
echo 'freshrender.label Freshly rendered'
|
||||
echo 'freshrender.draw STACK'
|
||||
echo 'freshrender.type DERIVE'
|
||||
echo 'freshrender.min 0'
|
||||
echo 'old.label Old from disk'
|
||||
echo 'old.draw STACK'
|
||||
echo 'old.type DERIVE'
|
||||
echo 'old.min 0'
|
||||
echo 'oldrender.label Old tile, attempted render'
|
||||
echo 'oldrender.draw STACK'
|
||||
echo 'oldrender.type DERIVE'
|
||||
echo 'oldrender.min 0'
|
||||
echo 'outdated.label Outdated from disk'
|
||||
echo 'outdated.draw STACK'
|
||||
echo 'outdated.type DERIVE'
|
||||
echo 'outdated.min 0'
|
||||
echo 'outdatedrender.label Outdated tile, attempted render'
|
||||
echo 'outdatedrender.draw STACK'
|
||||
echo 'outdatedrender.type DERIVE'
|
||||
echo 'outdatedrender.min 0'
|
||||
echo 'graph_title freshness of served tiles'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel tiles per ${graph_period}'
|
||||
echo 'graph_category mod_tile'
|
||||
echo 'fresh.label Fresh from disk'
|
||||
echo 'fresh.draw AREA'
|
||||
echo 'fresh.type DERIVE'
|
||||
echo 'fresh.min 0'
|
||||
echo 'freshrender.label Freshly rendered'
|
||||
echo 'freshrender.draw STACK'
|
||||
echo 'freshrender.type DERIVE'
|
||||
echo 'freshrender.min 0'
|
||||
echo 'old.label Old from disk'
|
||||
echo 'old.draw STACK'
|
||||
echo 'old.type DERIVE'
|
||||
echo 'old.min 0'
|
||||
echo 'oldrender.label Old tile, attempted render'
|
||||
echo 'oldrender.draw STACK'
|
||||
echo 'oldrender.type DERIVE'
|
||||
echo 'oldrender.min 0'
|
||||
echo 'outdated.label Outdated from disk'
|
||||
echo 'outdated.draw STACK'
|
||||
echo 'outdated.type DERIVE'
|
||||
echo 'outdated.min 0'
|
||||
echo 'outdatedrender.label Outdated tile, attempted render'
|
||||
echo 'outdatedrender.draw STACK'
|
||||
echo 'outdatedrender.type DERIVE'
|
||||
echo 'outdatedrender.min 0'
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
data=`wget -q http://localhost/mod_tile -O -`
|
||||
|
||||
fresh=`expr match "$data" '.*NoFreshCache: \([0-9]*\)'`
|
||||
freshRender=`expr match "$data" '.*NoFreshRender: \([0-9]*\)'`
|
||||
old=`expr match "$data" '.*NoOldCache: \([0-9]*\)'`
|
||||
oldRender=`expr match "$data" '.*NoOldRender: \([0-9]*\)'`
|
||||
outdated=`expr match "$data" '.*NoVeryOldCache: \([0-9]*\)'`
|
||||
outdatedRender=`expr match "$data" '.*NoVeryOldRender: \([0-9]*\)'`
|
||||
data=$(wget -q http://localhost/mod_tile -O -)
|
||||
|
||||
fresh=$(expr match "$data" '.*NoFreshCache: \([0-9]*\)')
|
||||
freshRender=$(expr match "$data" '.*NoFreshRender: \([0-9]*\)')
|
||||
old=$(expr match "$data" '.*NoOldCache: \([0-9]*\)')
|
||||
oldRender=$(expr match "$data" '.*NoOldRender: \([0-9]*\)')
|
||||
outdated=$(expr match "$data" '.*NoVeryOldCache: \([0-9]*\)')
|
||||
outdatedRender=$(expr match "$data" '.*NoVeryOldRender: \([0-9]*\)')
|
||||
|
||||
echo "fresh.value " $fresh
|
||||
echo "freshrender.value " $freshRender
|
||||
|
@ -1,3 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the state / freshness of the tiles returned by mod_tile
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -13,204 +22,184 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the state / freshness of the tiles returned by mod_tile
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo 'graph_title avg latency of tile retrival from disk'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel latency in s'
|
||||
echo 'graph_category mod_tile'
|
||||
echo 'total.label All served tiles'
|
||||
echo 'total.draw LINE2'
|
||||
echo 'total.type GAUGE'
|
||||
echo 'total.min 0'
|
||||
echo 'z1.label z1-8'
|
||||
echo 'z1.draw LINE1'
|
||||
echo 'z1.type GAUGE'
|
||||
echo 'z1.min 0'
|
||||
echo 'z2.label z9-12'
|
||||
echo 'z2.draw LINE1'
|
||||
echo 'z2.type GAUGE'
|
||||
echo 'z2.min 0'
|
||||
echo 'z3.label z13-14'
|
||||
echo 'z3.draw LINE1'
|
||||
echo 'z3.type GAUGE'
|
||||
echo 'z3.min 0'
|
||||
echo 'z4.label z15-16'
|
||||
echo 'z4.draw LINE1'
|
||||
echo 'z4.type GAUGE'
|
||||
echo 'z4.min 0'
|
||||
echo 'z5.label z17-18'
|
||||
echo 'z5.draw LINE1'
|
||||
echo 'z5.type GAUGE'
|
||||
echo 'z5.min 0'
|
||||
echo 'z6.label z19-20'
|
||||
echo 'z6.draw LINE1'
|
||||
echo 'z6.type GAUGE'
|
||||
echo 'z6.min 0'
|
||||
echo 'graph_title avg latency of tile retrival from disk'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel latency in s'
|
||||
echo 'graph_category mod_tile'
|
||||
echo 'total.label All served tiles'
|
||||
echo 'total.draw LINE2'
|
||||
echo 'total.type GAUGE'
|
||||
echo 'total.min 0'
|
||||
echo 'z1.label z1-8'
|
||||
echo 'z1.draw LINE1'
|
||||
echo 'z1.type GAUGE'
|
||||
echo 'z1.min 0'
|
||||
echo 'z2.label z9-12'
|
||||
echo 'z2.draw LINE1'
|
||||
echo 'z2.type GAUGE'
|
||||
echo 'z2.min 0'
|
||||
echo 'z3.label z13-14'
|
||||
echo 'z3.draw LINE1'
|
||||
echo 'z3.type GAUGE'
|
||||
echo 'z3.min 0'
|
||||
echo 'z4.label z15-16'
|
||||
echo 'z4.draw LINE1'
|
||||
echo 'z4.type GAUGE'
|
||||
echo 'z4.min 0'
|
||||
echo 'z5.label z17-18'
|
||||
echo 'z5.draw LINE1'
|
||||
echo 'z5.type GAUGE'
|
||||
echo 'z5.min 0'
|
||||
echo 'z6.label z19-20'
|
||||
echo 'z6.draw LINE1'
|
||||
echo 'z6.type GAUGE'
|
||||
echo 'z6.min 0'
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#MUNIN_STATEFILE=latency.state
|
||||
|
||||
data=`wget -q http://localhost/mod_tile -O -`
|
||||
data=$(wget -q http://localhost/mod_tile -O -)
|
||||
|
||||
totalDuration=$(expr match "$data" '.*DurationTileBufferReads: \([0-9]*\)')
|
||||
noTotal=$(expr match "$data" '.*NoTileBufferReads: \([0-9]*\)')
|
||||
totalDurationPrev=$(sed -e '/^DurationTileBufferReads/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
noTotalPrev=$(sed -e '/^NoTileBufferReads/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
|
||||
totalDuration=`expr match "$data" '.*DurationTileBufferReads: \([0-9]*\)'`
|
||||
noTotal=`expr match "$data" '.*NoTileBufferReads: \([0-9]*\)'`
|
||||
totalDurationPrev=`sed -e '/^DurationTileBufferReads/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
noTotalPrev=`sed -e '/^NoTileBufferReads/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
z0Duration=$(expr match "$data" '.*DurationTileBufferReadZoom00: \([0-9]*\)')
|
||||
z1Duration=$(expr match "$data" '.*DurationTileBufferReadZoom01: \([0-9]*\)')
|
||||
z2Duration=$(expr match "$data" '.*DurationTileBufferReadZoom02: \([0-9]*\)')
|
||||
z3Duration=$(expr match "$data" '.*DurationTileBufferReadZoom03: \([0-9]*\)')
|
||||
z4Duration=$(expr match "$data" '.*DurationTileBufferReadZoom04: \([0-9]*\)')
|
||||
z5Duration=$(expr match "$data" '.*DurationTileBufferReadZoom05: \([0-9]*\)')
|
||||
z6Duration=$(expr match "$data" '.*DurationTileBufferReadZoom06: \([0-9]*\)')
|
||||
z7Duration=$(expr match "$data" '.*DurationTileBufferReadZoom07: \([0-9]*\)')
|
||||
z8Duration=$(expr match "$data" '.*DurationTileBufferReadZoom08: \([0-9]*\)')
|
||||
z9Duration=$(expr match "$data" '.*DurationTileBufferReadZoom09: \([0-9]*\)')
|
||||
z10Duration=$(expr match "$data" '.*DurationTileBufferReadZoom10: \([0-9]*\)')
|
||||
z11Duration=$(expr match "$data" '.*DurationTileBufferReadZoom11: \([0-9]*\)')
|
||||
z12Duration=$(expr match "$data" '.*DurationTileBufferReadZoom12: \([0-9]*\)')
|
||||
z13Duration=$(expr match "$data" '.*DurationTileBufferReadZoom13: \([0-9]*\)')
|
||||
z14Duration=$(expr match "$data" '.*DurationTileBufferReadZoom14: \([0-9]*\)')
|
||||
z15Duration=$(expr match "$data" '.*DurationTileBufferReadZoom15: \([0-9]*\)')
|
||||
z16Duration=$(expr match "$data" '.*DurationTileBufferReadZoom16: \([0-9]*\)')
|
||||
z17Duration=$(expr match "$data" '.*DurationTileBufferReadZoom17: \([0-9]*\)')
|
||||
z18Duration=$(expr match "$data" '.*DurationTileBufferReadZoom18: \([0-9]*\)')
|
||||
z19Duration=$(expr match "$data" '.*DurationTileBufferReadZoom19: \([0-9]*\)')
|
||||
z20Duration=$(expr match "$data" '.*DurationTileBufferReadZoom20: \([0-9]*\)')
|
||||
|
||||
z0Duration=`expr match "$data" '.*DurationTileBufferReadZoom00: \([0-9]*\)'`
|
||||
z1Duration=`expr match "$data" '.*DurationTileBufferReadZoom01: \([0-9]*\)'`
|
||||
z2Duration=`expr match "$data" '.*DurationTileBufferReadZoom02: \([0-9]*\)'`
|
||||
z3Duration=`expr match "$data" '.*DurationTileBufferReadZoom03: \([0-9]*\)'`
|
||||
z4Duration=`expr match "$data" '.*DurationTileBufferReadZoom04: \([0-9]*\)'`
|
||||
z5Duration=`expr match "$data" '.*DurationTileBufferReadZoom05: \([0-9]*\)'`
|
||||
z6Duration=`expr match "$data" '.*DurationTileBufferReadZoom06: \([0-9]*\)'`
|
||||
z7Duration=`expr match "$data" '.*DurationTileBufferReadZoom07: \([0-9]*\)'`
|
||||
z8Duration=`expr match "$data" '.*DurationTileBufferReadZoom08: \([0-9]*\)'`
|
||||
z9Duration=`expr match "$data" '.*DurationTileBufferReadZoom09: \([0-9]*\)'`
|
||||
z10Duration=`expr match "$data" '.*DurationTileBufferReadZoom10: \([0-9]*\)'`
|
||||
z11Duration=`expr match "$data" '.*DurationTileBufferReadZoom11: \([0-9]*\)'`
|
||||
z12Duration=`expr match "$data" '.*DurationTileBufferReadZoom12: \([0-9]*\)'`
|
||||
z13Duration=`expr match "$data" '.*DurationTileBufferReadZoom13: \([0-9]*\)'`
|
||||
z14Duration=`expr match "$data" '.*DurationTileBufferReadZoom14: \([0-9]*\)'`
|
||||
z15Duration=`expr match "$data" '.*DurationTileBufferReadZoom15: \([0-9]*\)'`
|
||||
z16Duration=`expr match "$data" '.*DurationTileBufferReadZoom16: \([0-9]*\)'`
|
||||
z17Duration=`expr match "$data" '.*DurationTileBufferReadZoom17: \([0-9]*\)'`
|
||||
z18Duration=`expr match "$data" '.*DurationTileBufferReadZoom18: \([0-9]*\)'`
|
||||
z19Duration=`expr match "$data" '.*DurationTileBufferReadZoom19: \([0-9]*\)'`
|
||||
z20Duration=`expr match "$data" '.*DurationTileBufferReadZoom20: \([0-9]*\)'`
|
||||
if [ -z "$z19Duration" ]; then z19Duration=0; fi
|
||||
if [ -z "$z20Duration" ]; then z20Duration=0; fi
|
||||
|
||||
if [ -z "$z19Duration" ]; then z19Duration=0; fi;
|
||||
if [ -z "$z20Duration" ]; then z20Duration=0; fi;
|
||||
z0NoServed=$(expr match "$data" '.*NoTileBufferReadZoom00: \([0-9]*\)')
|
||||
z1NoServed=$(expr match "$data" '.*NoTileBufferReadZoom01: \([0-9]*\)')
|
||||
z2NoServed=$(expr match "$data" '.*NoTileBufferReadZoom02: \([0-9]*\)')
|
||||
z3NoServed=$(expr match "$data" '.*NoTileBufferReadZoom03: \([0-9]*\)')
|
||||
z4NoServed=$(expr match "$data" '.*NoTileBufferReadZoom04: \([0-9]*\)')
|
||||
z5NoServed=$(expr match "$data" '.*NoTileBufferReadZoom05: \([0-9]*\)')
|
||||
z6NoServed=$(expr match "$data" '.*NoTileBufferReadZoom06: \([0-9]*\)')
|
||||
z7NoServed=$(expr match "$data" '.*NoTileBufferReadZoom07: \([0-9]*\)')
|
||||
z8NoServed=$(expr match "$data" '.*NoTileBufferReadZoom08: \([0-9]*\)')
|
||||
z9NoServed=$(expr match "$data" '.*NoTileBufferReadZoom09: \([0-9]*\)')
|
||||
z10NoServed=$(expr match "$data" '.*NoTileBufferReadZoom10: \([0-9]*\)')
|
||||
z11NoServed=$(expr match "$data" '.*NoTileBufferReadZoom11: \([0-9]*\)')
|
||||
z12NoServed=$(expr match "$data" '.*NoTileBufferReadZoom12: \([0-9]*\)')
|
||||
z13NoServed=$(expr match "$data" '.*NoTileBufferReadZoom13: \([0-9]*\)')
|
||||
z14NoServed=$(expr match "$data" '.*NoTileBufferReadZoom14: \([0-9]*\)')
|
||||
z15NoServed=$(expr match "$data" '.*NoTileBufferReadZoom15: \([0-9]*\)')
|
||||
z16NoServed=$(expr match "$data" '.*NoTileBufferReadZoom16: \([0-9]*\)')
|
||||
z17NoServed=$(expr match "$data" '.*NoTileBufferReadZoom17: \([0-9]*\)')
|
||||
z18NoServed=$(expr match "$data" '.*NoTileBufferReadZoom18: \([0-9]*\)')
|
||||
z19NoServed=$(expr match "$data" '.*NoTileBufferReadZoom19: \([0-9]*\)')
|
||||
z20NoServed=$(expr match "$data" '.*NoTileBufferReadZoom20: \([0-9]*\)')
|
||||
|
||||
z0NoServed=`expr match "$data" '.*NoTileBufferReadZoom00: \([0-9]*\)'`
|
||||
z1NoServed=`expr match "$data" '.*NoTileBufferReadZoom01: \([0-9]*\)'`
|
||||
z2NoServed=`expr match "$data" '.*NoTileBufferReadZoom02: \([0-9]*\)'`
|
||||
z3NoServed=`expr match "$data" '.*NoTileBufferReadZoom03: \([0-9]*\)'`
|
||||
z4NoServed=`expr match "$data" '.*NoTileBufferReadZoom04: \([0-9]*\)'`
|
||||
z5NoServed=`expr match "$data" '.*NoTileBufferReadZoom05: \([0-9]*\)'`
|
||||
z6NoServed=`expr match "$data" '.*NoTileBufferReadZoom06: \([0-9]*\)'`
|
||||
z7NoServed=`expr match "$data" '.*NoTileBufferReadZoom07: \([0-9]*\)'`
|
||||
z8NoServed=`expr match "$data" '.*NoTileBufferReadZoom08: \([0-9]*\)'`
|
||||
z9NoServed=`expr match "$data" '.*NoTileBufferReadZoom09: \([0-9]*\)'`
|
||||
z10NoServed=`expr match "$data" '.*NoTileBufferReadZoom10: \([0-9]*\)'`
|
||||
z11NoServed=`expr match "$data" '.*NoTileBufferReadZoom11: \([0-9]*\)'`
|
||||
z12NoServed=`expr match "$data" '.*NoTileBufferReadZoom12: \([0-9]*\)'`
|
||||
z13NoServed=`expr match "$data" '.*NoTileBufferReadZoom13: \([0-9]*\)'`
|
||||
z14NoServed=`expr match "$data" '.*NoTileBufferReadZoom14: \([0-9]*\)'`
|
||||
z15NoServed=`expr match "$data" '.*NoTileBufferReadZoom15: \([0-9]*\)'`
|
||||
z16NoServed=`expr match "$data" '.*NoTileBufferReadZoom16: \([0-9]*\)'`
|
||||
z17NoServed=`expr match "$data" '.*NoTileBufferReadZoom17: \([0-9]*\)'`
|
||||
z18NoServed=`expr match "$data" '.*NoTileBufferReadZoom18: \([0-9]*\)'`
|
||||
z19NoServed=`expr match "$data" '.*NoTileBufferReadZoom19: \([0-9]*\)'`
|
||||
z20NoServed=`expr match "$data" '.*NoTileBufferReadZoom20: \([0-9]*\)'`
|
||||
if [ -z "$z19NoServed" ]; then z19NoServed=0; fi
|
||||
if [ -z "$z20NoServed" ]; then z20NoServed=0; fi
|
||||
|
||||
if [ -z "$z19NoServed" ]; then z19NoServed=0; fi;
|
||||
if [ -z "$z20NoServed" ]; then z20NoServed=0; fi;
|
||||
zl1Duration=$(expr $z0Duration + $z1Duration + $z2Duration + $z3Duration + $z4Duration + $z5Duration + $z6Duration + $z7Duration + $z8Duration)
|
||||
zl1NoServed=$(expr $z0NoServed + $z1NoServed + $z2NoServed + $z3NoServed + $z4NoServed + $z5NoServed + $z6NoServed + $z7NoServed + $z8NoServed)
|
||||
zl2Duration=$(expr $z9Duration + $z10Duration + $z11Duration + $z12Duration)
|
||||
zl2NoServed=$(expr $z9NoServed + $z10NoServed + $z11NoServed + $z12NoServed)
|
||||
zl3Duration=$(expr $z13Duration + $z14Duration)
|
||||
zl3NoServed=$(expr $z13NoServed + $z14NoServed)
|
||||
zl4Duration=$(expr $z15Duration + $z16Duration)
|
||||
zl4NoServed=$(expr $z15NoServed + $z16NoServed)
|
||||
zl5Duration=$(expr $z17Duration + $z18Duration)
|
||||
zl5NoServed=$(expr $z17NoServed + $z18NoServed)
|
||||
zl6Duration=$(expr $z19Duration + $z20Duration)
|
||||
zl6NoServed=$(expr $z19NoServed + $z20NoServed)
|
||||
|
||||
zl1Duration=`expr $z0Duration + $z1Duration + $z2Duration + $z3Duration + $z4Duration + $z5Duration + $z6Duration + $z7Duration + $z8Duration`
|
||||
zl1NoServed=`expr $z0NoServed + $z1NoServed + $z2NoServed + $z3NoServed + $z4NoServed + $z5NoServed + $z6NoServed + $z7NoServed + $z8NoServed`
|
||||
zl2Duration=`expr $z9Duration + $z10Duration + $z11Duration + $z12Duration`
|
||||
zl2NoServed=`expr $z9NoServed + $z10NoServed + $z11NoServed + $z12NoServed`
|
||||
zl3Duration=`expr $z13Duration + $z14Duration`
|
||||
zl3NoServed=`expr $z13NoServed + $z14NoServed`
|
||||
zl4Duration=`expr $z15Duration + $z16Duration`
|
||||
zl4NoServed=`expr $z15NoServed + $z16NoServed`
|
||||
zl5Duration=`expr $z17Duration + $z18Duration`
|
||||
zl5NoServed=`expr $z17NoServed + $z18NoServed`
|
||||
zl6Duration=`expr $z19Duration + $z20Duration`
|
||||
zl6NoServed=`expr $z19NoServed + $z20NoServed`
|
||||
zl1DurationPrev=$(sed -e '/^DurationTileBufferReadZoomGroup1/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
zl1NoServedPrev=$(sed -e '/^NoTileBufferReadZoomGroup1/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
zl2DurationPrev=$(sed -e '/^DurationTileBufferReadZoomGroup2/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
zl2NoServedPrev=$(sed -e '/^NoTileBufferReadZoomGroup2/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
zl3DurationPrev=$(sed -e '/^DurationTileBufferReadZoomGroup3/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
zl3NoServedPrev=$(sed -e '/^NoTileBufferReadZoomGroup3/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
zl4DurationPrev=$(sed -e '/^DurationTileBufferReadZoomGroup4/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
zl4NoServedPrev=$(sed -e '/^NoTileBufferReadZoomGroup4/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
zl5DurationPrev=$(sed -e '/^DurationTileBufferReadZoomGroup5/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
zl5NoServedPrev=$(sed -e '/^NoTileBufferReadZoomGroup5/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
zl6DurationPrev=$(sed -e '/^DurationTileBufferReadZoomGroup6/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
zl6NoServedPrev=$(sed -e '/^NoTileBufferReadZoomGroup6/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE)
|
||||
|
||||
zl1DurationPrev=`sed -e '/^DurationTileBufferReadZoomGroup1/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
zl1NoServedPrev=`sed -e '/^NoTileBufferReadZoomGroup1/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
zl2DurationPrev=`sed -e '/^DurationTileBufferReadZoomGroup2/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
zl2NoServedPrev=`sed -e '/^NoTileBufferReadZoomGroup2/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
zl3DurationPrev=`sed -e '/^DurationTileBufferReadZoomGroup3/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
zl3NoServedPrev=`sed -e '/^NoTileBufferReadZoomGroup3/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
zl4DurationPrev=`sed -e '/^DurationTileBufferReadZoomGroup4/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
zl4NoServedPrev=`sed -e '/^NoTileBufferReadZoomGroup4/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
zl5DurationPrev=`sed -e '/^DurationTileBufferReadZoomGroup5/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
zl5NoServedPrev=`sed -e '/^NoTileBufferReadZoomGroup5/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
zl6DurationPrev=`sed -e '/^DurationTileBufferReadZoomGroup6/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
zl6NoServedPrev=`sed -e '/^NoTileBufferReadZoomGroup6/!d' -e 's/.*: //' -e q $MUNIN_STATEFILE`
|
||||
echo "DurationTileBufferReads: $totalDuration" >$MUNIN_STATEFILE
|
||||
echo "NoTileBufferReads: $noTotal" >>$MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup1: $zl1Duration" >>$MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup1: $zl1NoServed" >>$MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup2: $zl2Duration" >>$MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup2: $zl2NoServed" >>$MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup3: $zl3Duration" >>$MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup3: $zl3NoServed" >>$MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup4: $zl4Duration" >>$MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup4: $zl4NoServed" >>$MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup5: $zl5Duration" >>$MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup5: $zl5NoServed" >>$MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup6: $zl6Duration" >>$MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup6: $zl6NoServed" >>$MUNIN_STATEFILE
|
||||
|
||||
|
||||
echo "DurationTileBufferReads: $totalDuration" > $MUNIN_STATEFILE
|
||||
echo "NoTileBufferReads: $noTotal" >> $MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup1: $zl1Duration" >> $MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup1: $zl1NoServed" >> $MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup2: $zl2Duration" >> $MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup2: $zl2NoServed" >> $MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup3: $zl3Duration" >> $MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup3: $zl3NoServed" >> $MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup4: $zl4Duration" >> $MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup4: $zl4NoServed" >> $MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup5: $zl5Duration" >> $MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup5: $zl5NoServed" >> $MUNIN_STATEFILE
|
||||
echo "DurationTileBufferReadZoomGroup6: $zl6Duration" >> $MUNIN_STATEFILE
|
||||
echo "NoTileBufferReadZoomGroup6: $zl6NoServed" >> $MUNIN_STATEFILE
|
||||
|
||||
|
||||
if [ "$noTotal" = "$noTotalPrev" ];
|
||||
then
|
||||
totalLatency=0
|
||||
if [ "$noTotal" = "$noTotalPrev" ]; then
|
||||
totalLatency=0
|
||||
else
|
||||
totalLatency=$(echo "$totalDuration $totalDurationPrev $noTotal $noTotalPrev" | awk '{ totalLat = ($1 - $2) / ($3 - $4) / 1000000.0; print totalLat}' )
|
||||
totalLatency=$(echo "$totalDuration $totalDurationPrev $noTotal $noTotalPrev" | awk '{ totalLat = ($1 - $2) / ($3 - $4) / 1000000.0; print totalLat}')
|
||||
fi
|
||||
|
||||
if [ "$zl1NoServed" = "$zl1NoServedPrev" ];
|
||||
then
|
||||
zl1Latency=0
|
||||
if [ "$zl1NoServed" = "$zl1NoServedPrev" ]; then
|
||||
zl1Latency=0
|
||||
else
|
||||
zl1Latency=$(echo "$zl1Duration $zl1DurationPrev $zl1NoServed $zl1NoServedPrev" | awk '{ zl1Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl1Lat}' )
|
||||
zl1Latency=$(echo "$zl1Duration $zl1DurationPrev $zl1NoServed $zl1NoServedPrev" | awk '{ zl1Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl1Lat}')
|
||||
fi
|
||||
|
||||
if [ "$zl2NoServed" = "$zl2NoServedPrev" ];
|
||||
then
|
||||
zl2Latency=0
|
||||
if [ "$zl2NoServed" = "$zl2NoServedPrev" ]; then
|
||||
zl2Latency=0
|
||||
else
|
||||
zl2Latency=$(echo "$zl2Duration $zl2DurationPrev $zl2NoServed $zl2NoServedPrev" | awk '{ zl2Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl2Lat}' )
|
||||
zl2Latency=$(echo "$zl2Duration $zl2DurationPrev $zl2NoServed $zl2NoServedPrev" | awk '{ zl2Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl2Lat}')
|
||||
fi
|
||||
|
||||
if [ "$zl3NoServed" = "$zl3NoServedPrev" ];
|
||||
then
|
||||
zl3Latency=0
|
||||
if [ "$zl3NoServed" = "$zl3NoServedPrev" ]; then
|
||||
zl3Latency=0
|
||||
else
|
||||
zl3Latency=$(echo "$zl3Duration $zl3DurationPrev $zl3NoServed $zl3NoServedPrev" | awk '{ zl3Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl3Lat}' )
|
||||
zl3Latency=$(echo "$zl3Duration $zl3DurationPrev $zl3NoServed $zl3NoServedPrev" | awk '{ zl3Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl3Lat}')
|
||||
fi
|
||||
|
||||
if [ "$zl4NoServed" = "$zl4NoServedPrev" ];
|
||||
then
|
||||
zl4Latency=0
|
||||
if [ "$zl4NoServed" = "$zl4NoServedPrev" ]; then
|
||||
zl4Latency=0
|
||||
else
|
||||
zl4Latency=$(echo "$zl4Duration $zl4DurationPrev $zl4NoServed $zl4NoServedPrev" | awk '{ zl4Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl4Lat}' )
|
||||
zl4Latency=$(echo "$zl4Duration $zl4DurationPrev $zl4NoServed $zl4NoServedPrev" | awk '{ zl4Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl4Lat}')
|
||||
fi
|
||||
|
||||
if [ "$zl5NoServed" = "$zl5NoServedPrev" ];
|
||||
then
|
||||
zl5Latency=0
|
||||
if [ "$zl5NoServed" = "$zl5NoServedPrev" ]; then
|
||||
zl5Latency=0
|
||||
else
|
||||
zl5Latency=$(echo "$zl5Duration $zl5DurationPrev $zl5NoServed $zl5NoServedPrev" | awk '{ zl5Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl5Lat}' )
|
||||
zl5Latency=$(echo "$zl5Duration $zl5DurationPrev $zl5NoServed $zl5NoServedPrev" | awk '{ zl5Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl5Lat}')
|
||||
fi
|
||||
|
||||
if [ "$zl6NoServed" = "$zl6NoServedPrev" ];
|
||||
then
|
||||
zl6Latency=0
|
||||
if [ "$zl6NoServed" = "$zl6NoServedPrev" ]; then
|
||||
zl6Latency=0
|
||||
else
|
||||
zl6Latency=$(echo "$zl6Duration $zl6DurationPrev $zl6NoServed $zl6NoServedPrev" | awk '{ zl6Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl6Lat}' )
|
||||
zl6Latency=$(echo "$zl6Duration $zl6DurationPrev $zl6NoServed $zl6NoServedPrev" | awk '{ zl6Lat = ($1 - $2) / ($3 - $4) / 1000000.0; print zl6Lat}')
|
||||
fi
|
||||
|
||||
echo "total.value " $totalLatency
|
||||
|
@ -1,3 +1,12 @@
|
||||
#!/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 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -13,49 +22,38 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the response codes of tiles returned by mod_tile
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
|
||||
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'
|
||||
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
|
||||
exit 0
|
||||
fi
|
||||
|
||||
data=$(wget -q http://localhost/mod_tile -O -)
|
||||
|
||||
data=`wget -q 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]*\)'`
|
||||
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
|
||||
|
@ -1,3 +1,12 @@
|
||||
#!/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 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -13,86 +22,73 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the response codes of tiles returned by mod_tile
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo 'graph_title mod_tile responses by zoom layer'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel responses per ${graph_period}'
|
||||
echo 'graph_category mod_tile'
|
||||
echo 'z1.label z1-8'
|
||||
echo 'z1.draw AREA'
|
||||
echo 'z1.type DERIVE'
|
||||
echo 'z1.min 0'
|
||||
echo 'z2.label z9-12'
|
||||
echo 'z2.draw STACK'
|
||||
echo 'z2.type DERIVE'
|
||||
echo 'z2.min 0'
|
||||
echo 'z3.label z13-14'
|
||||
echo 'z3.draw STACK'
|
||||
echo 'z3.type DERIVE'
|
||||
echo 'z3.min 0'
|
||||
echo 'z4.label z15-16'
|
||||
echo 'z4.draw STACK'
|
||||
echo 'z4.type DERIVE'
|
||||
echo 'z4.min 0'
|
||||
echo 'z5.label z17-18'
|
||||
echo 'z5.draw STACK'
|
||||
echo 'z5.type DERIVE'
|
||||
echo 'z5.min 0'
|
||||
echo 'z6.label z19-20'
|
||||
echo 'z6.draw STACK'
|
||||
echo 'z6.type DERIVE'
|
||||
echo 'z6.min 0'
|
||||
exit 0
|
||||
echo 'graph_title mod_tile responses by zoom layer'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel responses per ${graph_period}'
|
||||
echo 'graph_category mod_tile'
|
||||
echo 'z1.label z1-8'
|
||||
echo 'z1.draw AREA'
|
||||
echo 'z1.type DERIVE'
|
||||
echo 'z1.min 0'
|
||||
echo 'z2.label z9-12'
|
||||
echo 'z2.draw STACK'
|
||||
echo 'z2.type DERIVE'
|
||||
echo 'z2.min 0'
|
||||
echo 'z3.label z13-14'
|
||||
echo 'z3.draw STACK'
|
||||
echo 'z3.type DERIVE'
|
||||
echo 'z3.min 0'
|
||||
echo 'z4.label z15-16'
|
||||
echo 'z4.draw STACK'
|
||||
echo 'z4.type DERIVE'
|
||||
echo 'z4.min 0'
|
||||
echo 'z5.label z17-18'
|
||||
echo 'z5.draw STACK'
|
||||
echo 'z5.type DERIVE'
|
||||
echo 'z5.min 0'
|
||||
echo 'z6.label z19-20'
|
||||
echo 'z6.draw STACK'
|
||||
echo 'z6.type DERIVE'
|
||||
echo 'z6.min 0'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
data=$(wget -q http://localhost/mod_tile -O -)
|
||||
|
||||
data=`wget -q http://localhost/mod_tile -O -`
|
||||
|
||||
resp_0=`expr match "$data" '.*NoRespZoom00: \([0-9]*\)'`
|
||||
resp_1=`expr match "$data" '.*NoRespZoom01: \([0-9]*\)'`
|
||||
resp_2=`expr match "$data" '.*NoRespZoom02: \([0-9]*\)'`
|
||||
resp_3=`expr match "$data" '.*NoRespZoom03: \([0-9]*\)'`
|
||||
resp_4=`expr match "$data" '.*NoRespZoom04: \([0-9]*\)'`
|
||||
resp_5=`expr match "$data" '.*NoRespZoom05: \([0-9]*\)'`
|
||||
resp_6=`expr match "$data" '.*NoRespZoom06: \([0-9]*\)'`
|
||||
resp_7=`expr match "$data" '.*NoRespZoom07: \([0-9]*\)'`
|
||||
resp_8=`expr match "$data" '.*NoRespZoom08: \([0-9]*\)'`
|
||||
resp_9=`expr match "$data" '.*NoRespZoom09: \([0-9]*\)'`
|
||||
resp_10=`expr match "$data" '.*NoRespZoom10: \([0-9]*\)'`
|
||||
resp_11=`expr match "$data" '.*NoRespZoom11: \([0-9]*\)'`
|
||||
resp_12=`expr match "$data" '.*NoRespZoom12: \([0-9]*\)'`
|
||||
resp_13=`expr match "$data" '.*NoRespZoom13: \([0-9]*\)'`
|
||||
resp_14=`expr match "$data" '.*NoRespZoom14: \([0-9]*\)'`
|
||||
resp_15=`expr match "$data" '.*NoRespZoom15: \([0-9]*\)'`
|
||||
resp_16=`expr match "$data" '.*NoRespZoom16: \([0-9]*\)'`
|
||||
resp_17=`expr match "$data" '.*NoRespZoom17: \([0-9]*\)'`
|
||||
resp_18=`expr match "$data" '.*NoRespZoom18: \([0-9]*\)'`
|
||||
resp_19=`expr match "$data" '.*NoRespZoom19: \([0-9]*\)'`
|
||||
resp_20=`expr match "$data" '.*NoRespZoom20: \([0-9]*\)'`
|
||||
resp_0=$(expr match "$data" '.*NoRespZoom00: \([0-9]*\)')
|
||||
resp_1=$(expr match "$data" '.*NoRespZoom01: \([0-9]*\)')
|
||||
resp_2=$(expr match "$data" '.*NoRespZoom02: \([0-9]*\)')
|
||||
resp_3=$(expr match "$data" '.*NoRespZoom03: \([0-9]*\)')
|
||||
resp_4=$(expr match "$data" '.*NoRespZoom04: \([0-9]*\)')
|
||||
resp_5=$(expr match "$data" '.*NoRespZoom05: \([0-9]*\)')
|
||||
resp_6=$(expr match "$data" '.*NoRespZoom06: \([0-9]*\)')
|
||||
resp_7=$(expr match "$data" '.*NoRespZoom07: \([0-9]*\)')
|
||||
resp_8=$(expr match "$data" '.*NoRespZoom08: \([0-9]*\)')
|
||||
resp_9=$(expr match "$data" '.*NoRespZoom09: \([0-9]*\)')
|
||||
resp_10=$(expr match "$data" '.*NoRespZoom10: \([0-9]*\)')
|
||||
resp_11=$(expr match "$data" '.*NoRespZoom11: \([0-9]*\)')
|
||||
resp_12=$(expr match "$data" '.*NoRespZoom12: \([0-9]*\)')
|
||||
resp_13=$(expr match "$data" '.*NoRespZoom13: \([0-9]*\)')
|
||||
resp_14=$(expr match "$data" '.*NoRespZoom14: \([0-9]*\)')
|
||||
resp_15=$(expr match "$data" '.*NoRespZoom15: \([0-9]*\)')
|
||||
resp_16=$(expr match "$data" '.*NoRespZoom16: \([0-9]*\)')
|
||||
resp_17=$(expr match "$data" '.*NoRespZoom17: \([0-9]*\)')
|
||||
resp_18=$(expr match "$data" '.*NoRespZoom18: \([0-9]*\)')
|
||||
resp_19=$(expr match "$data" '.*NoRespZoom19: \([0-9]*\)')
|
||||
resp_20=$(expr match "$data" '.*NoRespZoom20: \([0-9]*\)')
|
||||
|
||||
if [ -z "$resp_19" ]; then
|
||||
resp_19=0;
|
||||
resp_19=0
|
||||
fi
|
||||
if [ -z "$resp_20" ]; then
|
||||
resp_20=0;
|
||||
resp_20=0
|
||||
fi
|
||||
|
||||
|
||||
|
||||
echo "z1.value " `expr $resp_0 + $resp_1 + + $resp_2 + $resp_3 + $resp_4 + $resp_5 + $resp_6 + $resp_7 + $resp_8`
|
||||
echo "z2.value " `expr $resp_9 + $resp_10 + + $resp_11 + $resp_12`
|
||||
echo "z3.value " `expr $resp_13 + $resp_14`
|
||||
echo "z4.value " `expr $resp_15 + $resp_16`
|
||||
echo "z5.value " `expr $resp_17 + $resp_18`
|
||||
echo "z6.value " `expr $resp_19 + $resp_20`
|
||||
echo "z1.value " $(expr $resp_0 + $resp_1 + + $resp_2 + $resp_3 + $resp_4 + $resp_5 + $resp_6 + $resp_7 + $resp_8)
|
||||
echo "z2.value " $(expr $resp_9 + $resp_10 + + $resp_11 + $resp_12)
|
||||
echo "z3.value " $(expr $resp_13 + $resp_14)
|
||||
echo "z4.value " $(expr $resp_15 + $resp_16)
|
||||
echo "z5.value " $(expr $resp_17 + $resp_18)
|
||||
echo "z6.value " $(expr $resp_19 + $resp_20)
|
||||
|
@ -1,3 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the rendering throughput of Renderd
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -13,63 +22,53 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the rendering throughput of Renderd
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo 'graph_title Renderd throughput'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel Metatiles per ${graph_period}'
|
||||
echo 'graph_category renderd'
|
||||
echo 'graph_info Displays the number of metatiles being rendered by renderd per ${graph_period}'
|
||||
echo 'req.label Request Queue'
|
||||
echo 'req.type DERIVE'
|
||||
echo 'req.min 0'
|
||||
echo 'req.draw AREA'
|
||||
echo 'req.info Throughput of Metatiles submitted for on the fly rendering'
|
||||
echo 'reqLow.label Low priority request Queue'
|
||||
echo 'reqLow.type DERIVE'
|
||||
echo 'reqLow.min 0'
|
||||
echo 'reqLow.draw STACK'
|
||||
echo 'reqLow.info Throughput of Metatiles submitted low priority for on the fly rendering'
|
||||
echo 'reqPrio.label Priority request Queue'
|
||||
echo 'reqPrio.type DERIVE'
|
||||
echo 'reqPrio.min 0'
|
||||
echo 'reqPrio.draw STACK'
|
||||
echo 'reqPrio.info Throughput of Metatiles submitted high priority for on the fly rendering'
|
||||
echo 'dirty.label Dirty Queue'
|
||||
echo 'dirty.type DERIVE'
|
||||
echo 'dirty.min 0'
|
||||
echo 'dirty.draw STACK'
|
||||
echo 'dirty.info Throughput of dirty Metatiles submitted for re-render'
|
||||
echo 'reqBulk.label Bulk request Queue'
|
||||
echo 'reqBulk.type DERIVE'
|
||||
echo 'reqBulk.min 0'
|
||||
echo 'reqBulk.draw STACK'
|
||||
echo 'reqBulk.info Throughput of Metatiles submitted with background priority'
|
||||
echo 'dropped.label Dropped (x20)'
|
||||
echo 'dropped.type DERIVE'
|
||||
echo 'dropped.min 0'
|
||||
echo 'dropped.draw LINE2'
|
||||
echo 'dropped.info Number of Tiles dropped due to queue overload (x20)'
|
||||
echo 'dropped.cdef dropped,20,/'
|
||||
exit 0
|
||||
echo 'graph_title Renderd throughput'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel Metatiles per ${graph_period}'
|
||||
echo 'graph_category renderd'
|
||||
echo 'graph_info Displays the number of metatiles being rendered by renderd per ${graph_period}'
|
||||
echo 'req.label Request Queue'
|
||||
echo 'req.type DERIVE'
|
||||
echo 'req.min 0'
|
||||
echo 'req.draw AREA'
|
||||
echo 'req.info Throughput of Metatiles submitted for on the fly rendering'
|
||||
echo 'reqLow.label Low priority request Queue'
|
||||
echo 'reqLow.type DERIVE'
|
||||
echo 'reqLow.min 0'
|
||||
echo 'reqLow.draw STACK'
|
||||
echo 'reqLow.info Throughput of Metatiles submitted low priority for on the fly rendering'
|
||||
echo 'reqPrio.label Priority request Queue'
|
||||
echo 'reqPrio.type DERIVE'
|
||||
echo 'reqPrio.min 0'
|
||||
echo 'reqPrio.draw STACK'
|
||||
echo 'reqPrio.info Throughput of Metatiles submitted high priority for on the fly rendering'
|
||||
echo 'dirty.label Dirty Queue'
|
||||
echo 'dirty.type DERIVE'
|
||||
echo 'dirty.min 0'
|
||||
echo 'dirty.draw STACK'
|
||||
echo 'dirty.info Throughput of dirty Metatiles submitted for re-render'
|
||||
echo 'reqBulk.label Bulk request Queue'
|
||||
echo 'reqBulk.type DERIVE'
|
||||
echo 'reqBulk.min 0'
|
||||
echo 'reqBulk.draw STACK'
|
||||
echo 'reqBulk.info Throughput of Metatiles submitted with background priority'
|
||||
echo 'dropped.label Dropped (x20)'
|
||||
echo 'dropped.type DERIVE'
|
||||
echo 'dropped.min 0'
|
||||
echo 'dropped.draw LINE2'
|
||||
echo 'dropped.info Number of Tiles dropped due to queue overload (x20)'
|
||||
echo 'dropped.cdef dropped,20,/'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
reqprocessed=`sed -e '/^ReqRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
reqprioprocessed=`sed -e '/^ReqPrioRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
reqpriolowprocessed=`sed -e '/^ReqLowRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
dirtprocessed=`sed -e '/^DirtyRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
reqbulkprocessed=`sed -e '/^ReqBulkRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
dropped=`sed -e '/^DropedRequest/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
reqprocessed=$(sed -e '/^ReqRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
reqprioprocessed=$(sed -e '/^ReqPrioRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
reqpriolowprocessed=$(sed -e '/^ReqLowRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
dirtprocessed=$(sed -e '/^DirtyRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
reqbulkprocessed=$(sed -e '/^ReqBulkRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
dropped=$(sed -e '/^DropedRequest/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
|
||||
echo "req.value " $reqprocessed
|
||||
echo "reqLow.value " $reqpriolowprocessed
|
||||
|
@ -1,3 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor queue length of tiles submited for rendering in renderd
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -13,45 +22,35 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor queue length of tiles submited for rendering in renderd
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo 'graph_title Renderd queue length'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel metatiles'
|
||||
echo 'graph_category renderd'
|
||||
echo 'reqPrio.label Priority request Queue'
|
||||
echo 'reqPrio.type GAUGE'
|
||||
echo 'reqPrio.max 100'
|
||||
echo 'req.label Request Queue'
|
||||
echo 'req.type GAUGE'
|
||||
echo 'req.max 100'
|
||||
echo 'reqLow.label Low priority request Queue'
|
||||
echo 'reqLow.type GAUGE'
|
||||
echo 'reqLow.max 100'
|
||||
echo 'dirty.label Dirty Queue'
|
||||
echo 'dirty.type GAUGE'
|
||||
echo 'dirty.max 1000'
|
||||
echo 'reqBulk.label Bulk request Queue'
|
||||
echo 'reqBulk.type GAUGE'
|
||||
echo 'reqBulk.max 100'
|
||||
exit 0
|
||||
echo 'graph_title Renderd queue length'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel metatiles'
|
||||
echo 'graph_category renderd'
|
||||
echo 'reqPrio.label Priority request Queue'
|
||||
echo 'reqPrio.type GAUGE'
|
||||
echo 'reqPrio.max 100'
|
||||
echo 'req.label Request Queue'
|
||||
echo 'req.type GAUGE'
|
||||
echo 'req.max 100'
|
||||
echo 'reqLow.label Low priority request Queue'
|
||||
echo 'reqLow.type GAUGE'
|
||||
echo 'reqLow.max 100'
|
||||
echo 'dirty.label Dirty Queue'
|
||||
echo 'dirty.type GAUGE'
|
||||
echo 'dirty.max 1000'
|
||||
echo 'reqBulk.label Bulk request Queue'
|
||||
echo 'reqBulk.type GAUGE'
|
||||
echo 'reqBulk.max 100'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
reqlength=`sed -e '/^ReqQueueLength/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
reqpriolength=`sed -e '/^ReqPrioQueueLength/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
reqpriolowlength=`sed -e '/^ReqLowQueueLength/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
reqbulklength=`sed -e '/^ReqBulkQueueLength/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
dirtlength=`sed -e '/^DirtQueueLength/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
reqlength=$(sed -e '/^ReqQueueLength/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
reqpriolength=$(sed -e '/^ReqPrioQueueLength/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
reqpriolowlength=$(sed -e '/^ReqLowQueueLength/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
reqbulklength=$(sed -e '/^ReqBulkQueueLength/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
dirtlength=$(sed -e '/^DirtQueueLength/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
|
||||
echo "reqPrio.value " $reqpriolength
|
||||
echo "req.value " $reqlength
|
||||
|
@ -1,3 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor queue time spent rendering per queue by renderd
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -13,61 +22,50 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor queue time spent rendering per queue by renderd
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo 'graph_title Renderd time spent by queue'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel time spent per ${graph_period}'
|
||||
echo 'graph_category renderd'
|
||||
echo 'reqPrio.label Priority request queue'
|
||||
echo 'reqPrio.type DERIVE'
|
||||
echo 'reqPrio.cdef reqPrio,1000,/'
|
||||
echo 'reqPrio.min 0'
|
||||
echo 'reqPrio.draw AREA'
|
||||
echo 'reqPrio.info Time for priority request queue'
|
||||
echo 'req.label Request queue'
|
||||
echo 'req.type DERIVE'
|
||||
echo 'req.cdef req,1000,/'
|
||||
echo 'req.min 0'
|
||||
echo 'req.draw STACK'
|
||||
echo 'req.info Time for Request queue'
|
||||
echo 'reqLow.label Low priority request queue'
|
||||
echo 'reqLow.type DERIVE'
|
||||
echo 'reqLow.cdef reqLow,1000,/'
|
||||
echo 'reqLow.min 0'
|
||||
echo 'reqLow.draw STACK'
|
||||
echo 'reqLow.info Time for low priority request queue'
|
||||
echo 'dirty.label Dirty queue'
|
||||
echo 'dirty.type DERIVE'
|
||||
echo 'dirty.cdef dirty,1000,/'
|
||||
echo 'dirty.min 0'
|
||||
echo 'dirty.draw STACK'
|
||||
echo 'dirty.info Time for dirty queue'
|
||||
echo 'reqBulk.label Bulk queue'
|
||||
echo 'reqBulk.type DERIVE'
|
||||
echo 'reqBulk.cdef reqBulk,1000,/'
|
||||
echo 'reqBulk.min 0'
|
||||
echo 'reqBulk.draw STACK'
|
||||
echo 'reqBulk.info Time for bulk queue'
|
||||
exit 0
|
||||
echo 'graph_title Renderd time spent by queue'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel time spent per ${graph_period}'
|
||||
echo 'graph_category renderd'
|
||||
echo 'reqPrio.label Priority request queue'
|
||||
echo 'reqPrio.type DERIVE'
|
||||
echo 'reqPrio.cdef reqPrio,1000,/'
|
||||
echo 'reqPrio.min 0'
|
||||
echo 'reqPrio.draw AREA'
|
||||
echo 'reqPrio.info Time for priority request queue'
|
||||
echo 'req.label Request queue'
|
||||
echo 'req.type DERIVE'
|
||||
echo 'req.cdef req,1000,/'
|
||||
echo 'req.min 0'
|
||||
echo 'req.draw STACK'
|
||||
echo 'req.info Time for Request queue'
|
||||
echo 'reqLow.label Low priority request queue'
|
||||
echo 'reqLow.type DERIVE'
|
||||
echo 'reqLow.cdef reqLow,1000,/'
|
||||
echo 'reqLow.min 0'
|
||||
echo 'reqLow.draw STACK'
|
||||
echo 'reqLow.info Time for low priority request queue'
|
||||
echo 'dirty.label Dirty queue'
|
||||
echo 'dirty.type DERIVE'
|
||||
echo 'dirty.cdef dirty,1000,/'
|
||||
echo 'dirty.min 0'
|
||||
echo 'dirty.draw STACK'
|
||||
echo 'dirty.info Time for dirty queue'
|
||||
echo 'reqBulk.label Bulk queue'
|
||||
echo 'reqBulk.type DERIVE'
|
||||
echo 'reqBulk.cdef reqBulk,1000,/'
|
||||
echo 'reqBulk.min 0'
|
||||
echo 'reqBulk.draw STACK'
|
||||
echo 'reqBulk.info Time for bulk queue'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
reqTime=`sed -e '/^TimeRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
reqprioTime=`sed -e '/^TimePrioRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
reqpriolowTime=`sed -e '/^TimeLowRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
reqbulkTime=`sed -e '/^TimeBulkRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
dirtyTime=`sed -e '/^TimeDirtyRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
|
||||
reqTime=$(sed -e '/^TimeRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
reqprioTime=$(sed -e '/^TimePrioRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
reqpriolowTime=$(sed -e '/^TimeLowRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
reqbulkTime=$(sed -e '/^TimeBulkRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
dirtyTime=$(sed -e '/^TimeDirtyRendered/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
|
||||
echo "req.value " $reqTime
|
||||
echo "reqLow.value " $reqpriolowTime
|
||||
|
@ -1,3 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the rendering throughput of Renderd
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -13,86 +22,75 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the rendering throughput of Renderd
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo 'graph_title Renderd throughput by zoom'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel Metatiles per ${graph_period}'
|
||||
echo 'graph_category renderd'
|
||||
echo 'graph_info Displays the number of metatiles being rendered by renderd per ${graph_period}'
|
||||
echo 'z1.label zoom z0 - z8'
|
||||
echo 'z1.type DERIVE'
|
||||
echo 'z1.min 0'
|
||||
echo 'z1.draw AREA'
|
||||
echo 'z1.info Throughput of Metatiles for z0 - z8'
|
||||
echo 'z2.label zoom z9 - z12'
|
||||
echo 'z2.type DERIVE'
|
||||
echo 'z2.min 0'
|
||||
echo 'z2.draw STACK'
|
||||
echo 'z2.info Throughput of Metatiles for z9 - z12'
|
||||
echo 'z3.label zoom z13 - z14'
|
||||
echo 'z3.type DERIVE'
|
||||
echo 'z3.min 0'
|
||||
echo 'z3.draw STACK'
|
||||
echo 'z3.info Throughput of Metatiles for z13 - z14'
|
||||
echo 'z4.label zoom z15 - z16'
|
||||
echo 'z4.type DERIVE'
|
||||
echo 'z4.min 0'
|
||||
echo 'z4.draw STACK'
|
||||
echo 'z4.info Throughput of Metatiles for z15 - z16'
|
||||
echo 'z5.label zoom z17 - z18'
|
||||
echo 'z5.type DERIVE'
|
||||
echo 'z5.min 0'
|
||||
echo 'z5.draw STACK'
|
||||
echo 'z5.info Throughput of Metatiles for z17 - z18'
|
||||
echo 'z6.label zoom z19 - z20'
|
||||
echo 'z6.type DERIVE'
|
||||
echo 'z6.min 0'
|
||||
echo 'z6.draw STACK'
|
||||
echo 'z6.info Throughput of Metatiles for z19 - z20'
|
||||
echo 'graph_title Renderd throughput by zoom'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel Metatiles per ${graph_period}'
|
||||
echo 'graph_category renderd'
|
||||
echo 'graph_info Displays the number of metatiles being rendered by renderd per ${graph_period}'
|
||||
echo 'z1.label zoom z0 - z8'
|
||||
echo 'z1.type DERIVE'
|
||||
echo 'z1.min 0'
|
||||
echo 'z1.draw AREA'
|
||||
echo 'z1.info Throughput of Metatiles for z0 - z8'
|
||||
echo 'z2.label zoom z9 - z12'
|
||||
echo 'z2.type DERIVE'
|
||||
echo 'z2.min 0'
|
||||
echo 'z2.draw STACK'
|
||||
echo 'z2.info Throughput of Metatiles for z9 - z12'
|
||||
echo 'z3.label zoom z13 - z14'
|
||||
echo 'z3.type DERIVE'
|
||||
echo 'z3.min 0'
|
||||
echo 'z3.draw STACK'
|
||||
echo 'z3.info Throughput of Metatiles for z13 - z14'
|
||||
echo 'z4.label zoom z15 - z16'
|
||||
echo 'z4.type DERIVE'
|
||||
echo 'z4.min 0'
|
||||
echo 'z4.draw STACK'
|
||||
echo 'z4.info Throughput of Metatiles for z15 - z16'
|
||||
echo 'z5.label zoom z17 - z18'
|
||||
echo 'z5.type DERIVE'
|
||||
echo 'z5.min 0'
|
||||
echo 'z5.draw STACK'
|
||||
echo 'z5.info Throughput of Metatiles for z17 - z18'
|
||||
echo 'z6.label zoom z19 - z20'
|
||||
echo 'z6.type DERIVE'
|
||||
echo 'z6.min 0'
|
||||
echo 'z6.draw STACK'
|
||||
echo 'z6.info Throughput of Metatiles for z19 - z20'
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
req0=`sed -e '/^ZoomRendered00/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req1=`sed -e '/^ZoomRendered01/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req2=`sed -e '/^ZoomRendered02/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req3=`sed -e '/^ZoomRendered03/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req4=`sed -e '/^ZoomRendered04/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req5=`sed -e '/^ZoomRendered05/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req6=`sed -e '/^ZoomRendered06/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req7=`sed -e '/^ZoomRendered07/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req8=`sed -e '/^ZoomRendered08/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req9=`sed -e '/^ZoomRendered09/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req10=`sed -e '/^ZoomRendered10/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req11=`sed -e '/^ZoomRendered11/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req12=`sed -e '/^ZoomRendered12/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req13=`sed -e '/^ZoomRendered13/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req14=`sed -e '/^ZoomRendered14/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req15=`sed -e '/^ZoomRendered15/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req16=`sed -e '/^ZoomRendered16/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req17=`sed -e '/^ZoomRendered17/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req18=`sed -e '/^ZoomRendered18/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req19=`sed -e '/^ZoomRendered19/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req20=`sed -e '/^ZoomRendered20/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req0=$(sed -e '/^ZoomRendered00/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req1=$(sed -e '/^ZoomRendered01/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req2=$(sed -e '/^ZoomRendered02/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req3=$(sed -e '/^ZoomRendered03/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req4=$(sed -e '/^ZoomRendered04/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req5=$(sed -e '/^ZoomRendered05/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req6=$(sed -e '/^ZoomRendered06/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req7=$(sed -e '/^ZoomRendered07/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req8=$(sed -e '/^ZoomRendered08/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req9=$(sed -e '/^ZoomRendered09/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req10=$(sed -e '/^ZoomRendered10/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req11=$(sed -e '/^ZoomRendered11/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req12=$(sed -e '/^ZoomRendered12/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req13=$(sed -e '/^ZoomRendered13/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req14=$(sed -e '/^ZoomRendered14/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req15=$(sed -e '/^ZoomRendered15/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req16=$(sed -e '/^ZoomRendered16/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req17=$(sed -e '/^ZoomRendered17/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req18=$(sed -e '/^ZoomRendered18/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req19=$(sed -e '/^ZoomRendered19/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req20=$(sed -e '/^ZoomRendered20/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
|
||||
if [ -z req19 ]; then req19=0; fi
|
||||
if [ -z req20 ]; then req20=0; fi
|
||||
|
||||
|
||||
echo "z1.value " `expr $req0 + $req1 + + $req2 + $req3 + $req4 + $req5 + $req6 + $req7 + $req8`
|
||||
echo "z2.value " `expr $req9 + $req10 + + $req11 + $req12`
|
||||
echo "z3.value " `expr $req13 + $req14`
|
||||
echo "z4.value " `expr $req15 + $req16`
|
||||
echo "z5.value " `expr $req17 + $req18`
|
||||
echo "z6.value " `expr $req19 + $req20`
|
||||
echo "z1.value " $(expr $req0 + $req1 + + $req2 + $req3 + $req4 + $req5 + $req6 + $req7 + $req8)
|
||||
echo "z2.value " $(expr $req9 + $req10 + + $req11 + $req12)
|
||||
echo "z3.value " $(expr $req13 + $req14)
|
||||
echo "z4.value " $(expr $req15 + $req16)
|
||||
echo "z5.value " $(expr $req17 + $req18)
|
||||
echo "z6.value " $(expr $req19 + $req20)
|
||||
|
@ -1,3 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the time spent rendering per zoom by Renderd
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -13,93 +22,81 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the time spent rendering per zoom by Renderd
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo 'graph_title Renderd time spent by zoom'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel time spent per ${graph_period}'
|
||||
echo 'graph_category renderd'
|
||||
echo 'graph_info Displays the amount of time renderd has spent rendering tiles of a given zoom per ${graph_period}'
|
||||
echo 'zoomtime1.label zoom z0 - z8'
|
||||
echo 'zoomtime1.type DERIVE'
|
||||
echo 'zoomtime1.min 0'
|
||||
echo 'zoomtime1.cdef zoomtime1,1000,/'
|
||||
echo 'zoomtime1.draw AREA'
|
||||
echo 'zoomtime1.info Time for Metatiles z0 - z8'
|
||||
echo 'zoomtime2.label zoom z9 - z12'
|
||||
echo 'zoomtime2.type DERIVE'
|
||||
echo 'zoomtime2.min 0'
|
||||
echo 'zoomtime2.cdef zoomtime2,1000,/'
|
||||
echo 'zoomtime2.draw STACK'
|
||||
echo 'zoomtime2.info Time for Metatiles for z9 - z12'
|
||||
echo 'zoomtime3.label zoom z13 - z14'
|
||||
echo 'zoomtime3.type DERIVE'
|
||||
echo 'zoomtime3.min 0'
|
||||
echo 'zoomtime3.cdef zoomtime3,1000,/'
|
||||
echo 'zoomtime3.draw STACK'
|
||||
echo 'zoomtime3.info Time for Metatiles for z13 - z14'
|
||||
echo 'zoomtime4.label zoom z15 - z16'
|
||||
echo 'zoomtime4.type DERIVE'
|
||||
echo 'zoomtime4.min 0'
|
||||
echo 'zoomtime4.cdef zoomtime4,1000,/'
|
||||
echo 'zoomtime4.draw STACK'
|
||||
echo 'zoomtime4.info Time for Metatiles for z15 - z16'
|
||||
echo 'zoomtime5.label zoom z17 - z18'
|
||||
echo 'zoomtime5.type DERIVE'
|
||||
echo 'zoomtime5.min 0'
|
||||
echo 'zoomtime5.cdef zoomtime5,1000,/'
|
||||
echo 'zoomtime5.draw STACK'
|
||||
echo 'zoomtime5.info Time for Metatiles for z17 - z18'
|
||||
echo 'zoomtime6.label zoom z19 - z20'
|
||||
echo 'zoomtime6.type DERIVE'
|
||||
echo 'zoomtime6.min 0'
|
||||
echo 'zoomtime6.cdef zoomtime6,1000,/'
|
||||
echo 'zoomtime6.draw STACK'
|
||||
echo 'zoomtime6.info Time for Metatiles for z19 - z20'
|
||||
echo 'graph_title Renderd time spent by zoom'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel time spent per ${graph_period}'
|
||||
echo 'graph_category renderd'
|
||||
echo 'graph_info Displays the amount of time renderd has spent rendering tiles of a given zoom per ${graph_period}'
|
||||
echo 'zoomtime1.label zoom z0 - z8'
|
||||
echo 'zoomtime1.type DERIVE'
|
||||
echo 'zoomtime1.min 0'
|
||||
echo 'zoomtime1.cdef zoomtime1,1000,/'
|
||||
echo 'zoomtime1.draw AREA'
|
||||
echo 'zoomtime1.info Time for Metatiles z0 - z8'
|
||||
echo 'zoomtime2.label zoom z9 - z12'
|
||||
echo 'zoomtime2.type DERIVE'
|
||||
echo 'zoomtime2.min 0'
|
||||
echo 'zoomtime2.cdef zoomtime2,1000,/'
|
||||
echo 'zoomtime2.draw STACK'
|
||||
echo 'zoomtime2.info Time for Metatiles for z9 - z12'
|
||||
echo 'zoomtime3.label zoom z13 - z14'
|
||||
echo 'zoomtime3.type DERIVE'
|
||||
echo 'zoomtime3.min 0'
|
||||
echo 'zoomtime3.cdef zoomtime3,1000,/'
|
||||
echo 'zoomtime3.draw STACK'
|
||||
echo 'zoomtime3.info Time for Metatiles for z13 - z14'
|
||||
echo 'zoomtime4.label zoom z15 - z16'
|
||||
echo 'zoomtime4.type DERIVE'
|
||||
echo 'zoomtime4.min 0'
|
||||
echo 'zoomtime4.cdef zoomtime4,1000,/'
|
||||
echo 'zoomtime4.draw STACK'
|
||||
echo 'zoomtime4.info Time for Metatiles for z15 - z16'
|
||||
echo 'zoomtime5.label zoom z17 - z18'
|
||||
echo 'zoomtime5.type DERIVE'
|
||||
echo 'zoomtime5.min 0'
|
||||
echo 'zoomtime5.cdef zoomtime5,1000,/'
|
||||
echo 'zoomtime5.draw STACK'
|
||||
echo 'zoomtime5.info Time for Metatiles for z17 - z18'
|
||||
echo 'zoomtime6.label zoom z19 - z20'
|
||||
echo 'zoomtime6.type DERIVE'
|
||||
echo 'zoomtime6.min 0'
|
||||
echo 'zoomtime6.cdef zoomtime6,1000,/'
|
||||
echo 'zoomtime6.draw STACK'
|
||||
echo 'zoomtime6.info Time for Metatiles for z19 - z20'
|
||||
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
req0=`sed -e '/^TimeRenderedZoom00/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req1=`sed -e '/^TimeRenderedZoom01/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req2=`sed -e '/^TimeRenderedZoom02/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req3=`sed -e '/^TimeRenderedZoom03/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req4=`sed -e '/^TimeRenderedZoom04/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req5=`sed -e '/^TimeRenderedZoom05/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req6=`sed -e '/^TimeRenderedZoom06/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req7=`sed -e '/^TimeRenderedZoom07/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req8=`sed -e '/^TimeRenderedZoom08/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req9=`sed -e '/^TimeRenderedZoom09/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req10=`sed -e '/^TimeRenderedZoom10/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req11=`sed -e '/^TimeRenderedZoom11/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req12=`sed -e '/^TimeRenderedZoom12/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req13=`sed -e '/^TimeRenderedZoom13/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req14=`sed -e '/^TimeRenderedZoom14/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req15=`sed -e '/^TimeRenderedZoom15/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req16=`sed -e '/^TimeRenderedZoom16/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req17=`sed -e '/^TimeRenderedZoom17/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req18=`sed -e '/^TimeRenderedZoom18/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req19=`sed -e '/^TimeRenderedZoom19/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req20=`sed -e '/^TimeRenderedZoom20/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats`
|
||||
req0=$(sed -e '/^TimeRenderedZoom00/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req1=$(sed -e '/^TimeRenderedZoom01/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req2=$(sed -e '/^TimeRenderedZoom02/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req3=$(sed -e '/^TimeRenderedZoom03/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req4=$(sed -e '/^TimeRenderedZoom04/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req5=$(sed -e '/^TimeRenderedZoom05/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req6=$(sed -e '/^TimeRenderedZoom06/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req7=$(sed -e '/^TimeRenderedZoom07/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req8=$(sed -e '/^TimeRenderedZoom08/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req9=$(sed -e '/^TimeRenderedZoom09/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req10=$(sed -e '/^TimeRenderedZoom10/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req11=$(sed -e '/^TimeRenderedZoom11/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req12=$(sed -e '/^TimeRenderedZoom12/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req13=$(sed -e '/^TimeRenderedZoom13/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req14=$(sed -e '/^TimeRenderedZoom14/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req15=$(sed -e '/^TimeRenderedZoom15/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req16=$(sed -e '/^TimeRenderedZoom16/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req17=$(sed -e '/^TimeRenderedZoom17/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req18=$(sed -e '/^TimeRenderedZoom18/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req19=$(sed -e '/^TimeRenderedZoom19/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
req20=$(sed -e '/^TimeRenderedZoom20/!d' -e 's/.*: //' -e q /run/renderd/renderd.stats)
|
||||
|
||||
if [ -z "$req19" ]; then req19=0; fi
|
||||
if [ -z "$req20" ]; then req20=0; fi
|
||||
|
||||
|
||||
echo "zoomtime1.value " `expr $req0 + $req1 + + $req2 + $req3 + $req4 + $req5 + $req6 + $req7 + $req8`
|
||||
echo "zoomtime2.value " `expr $req9 + $req10 + + $req11 + $req12`
|
||||
echo "zoomtime3.value " `expr $req13 + $req14`
|
||||
echo "zoomtime4.value " `expr $req15 + $req16`
|
||||
echo "zoomtime5.value " `expr $req17 + $req18`
|
||||
echo "zoomtime6.value " `expr $req19 + $req20`
|
||||
echo "zoomtime1.value " $(expr $req0 + $req1 + + $req2 + $req3 + $req4 + $req5 + $req6 + $req7 + $req8)
|
||||
echo "zoomtime2.value " $(expr $req9 + $req10 + + $req11 + $req12)
|
||||
echo "zoomtime3.value " $(expr $req13 + $req14)
|
||||
echo "zoomtime4.value " $(expr $req15 + $req16)
|
||||
echo "zoomtime5.value " $(expr $req17 + $req18)
|
||||
echo "zoomtime6.value " $(expr $req19 + $req20)
|
||||
|
@ -1,3 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the age of the imported data in the rendering db
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -13,31 +22,20 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; If not, see http://www.gnu.org/licenses/.
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
# Plugin to monitor the age of the imported data in the rendering db
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional - used by munin-config)
|
||||
#
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo 'graph_title Data import lag'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel minutes'
|
||||
echo 'graph_category renderd'
|
||||
echo 'age.label DB import age'
|
||||
echo 'age.type GAUGE'
|
||||
echo 'age.cdef age,60,/'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
tstamp=`sed -e '/^timestamp=/!d' -e 's/.*=//' -e 's/Z//' -e 's/T/Z/' -e 's/\\\\//' -e 's/\\\\//' -e q /home/osm/replicate/state.txt`
|
||||
tstampsec=`date --date=$tstamp +%s`
|
||||
nowsec=`date +%s`
|
||||
|
||||
|
||||
echo "age.value " `expr $nowsec - $tstampsec`
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo 'graph_title Data import lag'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel minutes'
|
||||
echo 'graph_category renderd'
|
||||
echo 'age.label DB import age'
|
||||
echo 'age.type GAUGE'
|
||||
echo 'age.cdef age,60,/'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
tstamp=$(sed -e '/^timestamp=/!d' -e 's/.*=//' -e 's/Z//' -e 's/T/Z/' -e 's/\\\\//' -e 's/\\\\//' -e q /home/osm/replicate/state.txt)
|
||||
tstampsec=$(date --date=$tstamp +%s)
|
||||
nowsec=$(date +%s)
|
||||
|
||||
echo "age.value " $(expr $nowsec - $tstampsec)
|
||||
|
@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -9,12 +11,10 @@
|
||||
# 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/.
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
#*************************************************************************
|
||||
@ -44,95 +44,86 @@ EXPIRY_MAXZOOM=18
|
||||
#*************************************************************************
|
||||
#*************************************************************************
|
||||
|
||||
m_info()
|
||||
{
|
||||
echo "[`date +"%Y-%m-%d %H:%M:%S"`] $$ $1" >> "$RUNLOG"
|
||||
m_info() {
|
||||
echo "[$(date +"%Y-%m-%d %H:%M:%S")] $$ $1" >>"$RUNLOG"
|
||||
}
|
||||
|
||||
m_error()
|
||||
{
|
||||
echo "[`date +"%Y-%m-%d %H:%M:%S"`] $$ [error] $1" >> "$RUNLOG"
|
||||
|
||||
m_info "resetting state"
|
||||
/bin/cp $WORKOSM_DIR/last.state.txt $WORKOSM_DIR/state.txt || true
|
||||
|
||||
rm "$CHANGE_FILE" || true
|
||||
rm "$EXPIRY_FILE.$$" || true
|
||||
rm "$LOCK_FILE"
|
||||
exit
|
||||
m_error() {
|
||||
echo "[$(date +"%Y-%m-%d %H:%M:%S")] $$ [error] $1" >>"$RUNLOG"
|
||||
|
||||
m_info "resetting state"
|
||||
/bin/cp $WORKOSM_DIR/last.state.txt $WORKOSM_DIR/state.txt || true
|
||||
|
||||
rm "$CHANGE_FILE" || true
|
||||
rm "$EXPIRY_FILE.$$" || true
|
||||
rm "$LOCK_FILE"
|
||||
exit
|
||||
}
|
||||
|
||||
m_ok()
|
||||
{
|
||||
echo "[`date +"%Y-%m-%d %H:%M:%S"`] $$ $1" >> "$RUNLOG"
|
||||
m_ok() {
|
||||
echo "[$(date +"%Y-%m-%d %H:%M:%S")] $$ $1" >>"$RUNLOG"
|
||||
}
|
||||
|
||||
getlock()
|
||||
{
|
||||
if [ -s $1 ]; then
|
||||
if [ "$(ps -p `cat $1` | wc -l)" -gt 1 ]; then
|
||||
return 1 #false
|
||||
fi
|
||||
getlock() {
|
||||
if [ -s $1 ]; then
|
||||
if [ "$(ps -p $(cat $1) | wc -l)" -gt 1 ]; then
|
||||
return 1 #false
|
||||
fi
|
||||
|
||||
echo $$ >"$1"
|
||||
return 0 #true
|
||||
fi
|
||||
|
||||
echo $$ >"$1"
|
||||
return 0 #true
|
||||
}
|
||||
|
||||
freelock()
|
||||
{
|
||||
rm "$1"
|
||||
rm "$CHANGE_FILE"
|
||||
freelock() {
|
||||
rm "$1"
|
||||
rm "$CHANGE_FILE"
|
||||
}
|
||||
|
||||
|
||||
if [ $# -eq 1 ] ; then
|
||||
m_info "Initialising Osmosis replication system to $1"
|
||||
mkdir $WORKOSM_DIR
|
||||
$OSMOSIS_BIN --read-replication-interval-init workingDirectory=$WORKOSM_DIR 1>&2 2> "$OSMOSISLOG"
|
||||
wget "https://replicate-sequences.osm.mazdermind.de/?"$1"T00:00:00Z" -O $WORKOSM_DIR/state.txt
|
||||
if [ $# -eq 1 ]; then
|
||||
m_info "Initialising Osmosis replication system to $1"
|
||||
mkdir $WORKOSM_DIR
|
||||
$OSMOSIS_BIN --read-replication-interval-init workingDirectory=$WORKOSM_DIR 1>&2 2>"$OSMOSISLOG"
|
||||
wget "https://replicate-sequences.osm.mazdermind.de/?"$1"T00:00:00Z" -O $WORKOSM_DIR/state.txt
|
||||
else
|
||||
# make sure the lockfile is removed when we exit and then claim it
|
||||
# make sure the lockfile is removed when we exit and then claim it
|
||||
|
||||
if ! getlock "$LOCK_FILE"; then
|
||||
m_info "pid `cat $LOCK_FILE` still running"
|
||||
exit 3
|
||||
fi
|
||||
if ! getlock "$LOCK_FILE"; then
|
||||
m_info "pid $(cat $LOCK_FILE) still running"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
if [ -e $STOP_FILE ]; then
|
||||
m_info "stopped"
|
||||
exit 2
|
||||
fi
|
||||
if [ -e $STOP_FILE ]; then
|
||||
m_info "stopped"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
seq=`cat $WORKOSM_DIR/state.txt | grep sequenceNumber | cut -d= -f2`
|
||||
seq=$(cat $WORKOSM_DIR/state.txt | grep sequenceNumber | cut -d= -f2)
|
||||
|
||||
m_ok "start import from seq-nr $seq, replag is `osmosis-db_replag -h`"
|
||||
m_ok "start import from seq-nr $seq, replag is $(osmosis-db_replag -h)"
|
||||
|
||||
/bin/cp $WORKOSM_DIR/state.txt $WORKOSM_DIR/last.state.txt
|
||||
m_ok "downloading diff"
|
||||
|
||||
if ! $OSMOSIS_BIN --read-replication-interval workingDirectory=$WORKOSM_DIR --simplify-change --write-xml-change $CHANGE_FILE 1>&2 2> "$OSMOSISLOG"; then
|
||||
m_error "Osmosis error"
|
||||
fi
|
||||
|
||||
m_ok "importing diff"
|
||||
EXPIRY_METAZOOM=`expr $EXPIRY_MAXZOOM - 3`
|
||||
if ! $OSM2PGSQL_BIN -a --slim -e$EXPIRY_METAZOOM:$EXPIRY_METAZOOM $OSM2PGSQL_OPTIONS -o "$EXPIRY_FILE.$$" $CHANGE_FILE 1>&2 2> "$PGSQLLOG"; then
|
||||
m_error "osm2pgsql error"
|
||||
fi
|
||||
/bin/cp $WORKOSM_DIR/state.txt $WORKOSM_DIR/last.state.txt
|
||||
m_ok "downloading diff"
|
||||
|
||||
freelock "$LOCK_FILE"
|
||||
if ! $OSMOSIS_BIN --read-replication-interval workingDirectory=$WORKOSM_DIR --simplify-change --write-xml-change $CHANGE_FILE 1>&2 2>"$OSMOSISLOG"; then
|
||||
m_error "Osmosis error"
|
||||
fi
|
||||
|
||||
m_ok "expiring tiles"
|
||||
if ! render_expired --min-zoom=$EXPIRY_MINZOOM --max-zoom=$EXPIRY_MAXZOOM --touch-from=$EXPIRY_MINZOOM -s /run/renderd.sock < "$EXPIRY_FILE.$$" 2>&1 | tail -8 >> "$EXPIRYLOG"; then
|
||||
m_info "Expiry failed"
|
||||
fi
|
||||
m_ok "importing diff"
|
||||
EXPIRY_METAZOOM=$(expr $EXPIRY_MAXZOOM - 3)
|
||||
if ! $OSM2PGSQL_BIN -a --slim -e$EXPIRY_METAZOOM:$EXPIRY_METAZOOM $OSM2PGSQL_OPTIONS -o "$EXPIRY_FILE.$$" $CHANGE_FILE 1>&2 2>"$PGSQLLOG"; then
|
||||
m_error "osm2pgsql error"
|
||||
fi
|
||||
|
||||
rm "$EXPIRY_FILE.$$"
|
||||
|
||||
m_ok "Done with import"
|
||||
|
||||
freelock "$LOCK_FILE"
|
||||
|
||||
|
||||
m_ok "expiring tiles"
|
||||
if ! render_expired --min-zoom=$EXPIRY_MINZOOM --max-zoom=$EXPIRY_MAXZOOM --touch-from=$EXPIRY_MINZOOM -s /run/renderd.sock <"$EXPIRY_FILE.$$" 2>&1 | tail -8 >>"$EXPIRYLOG"; then
|
||||
m_info "Expiry failed"
|
||||
fi
|
||||
|
||||
rm "$EXPIRY_FILE.$$"
|
||||
|
||||
m_ok "Done with import"
|
||||
|
||||
fi
|
||||
|
@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -9,12 +11,10 @@
|
||||
# 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/.
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -78,141 +78,132 @@ EXPIRY_MAXZOOM=20
|
||||
#*************************************************************************
|
||||
#*************************************************************************
|
||||
|
||||
m_info()
|
||||
{
|
||||
echo "[`date +"%Y-%m-%d %H:%M:%S"`] $$ $1" >> "$RUNLOG"
|
||||
m_info() {
|
||||
echo "[$(date +"%Y-%m-%d %H:%M:%S")] $$ $1" >>"$RUNLOG"
|
||||
}
|
||||
|
||||
m_error()
|
||||
{
|
||||
echo "[`date +"%Y-%m-%d %H:%M:%S"`] $$ [error] $1" >> "$RUNLOG"
|
||||
|
||||
m_info "resetting state"
|
||||
/bin/cp $WORKOSM_DIR/last.state.txt $WORKOSM_DIR/state.txt || true
|
||||
|
||||
rm "$CHANGE_FILE" || true
|
||||
rm "$EXPIRY_FILE.$$" || true
|
||||
rm "$LOCK_FILE"
|
||||
exit
|
||||
m_error() {
|
||||
echo "[$(date +"%Y-%m-%d %H:%M:%S")] $$ [error] $1" >>"$RUNLOG"
|
||||
|
||||
m_info "resetting state"
|
||||
/bin/cp $WORKOSM_DIR/last.state.txt $WORKOSM_DIR/state.txt || true
|
||||
|
||||
rm "$CHANGE_FILE" || true
|
||||
rm "$EXPIRY_FILE.$$" || true
|
||||
rm "$LOCK_FILE"
|
||||
exit
|
||||
}
|
||||
|
||||
m_ok()
|
||||
{
|
||||
echo "[`date +"%Y-%m-%d %H:%M:%S"`] $$ $1" >> "$RUNLOG"
|
||||
m_ok() {
|
||||
echo "[$(date +"%Y-%m-%d %H:%M:%S")] $$ $1" >>"$RUNLOG"
|
||||
}
|
||||
|
||||
getlock()
|
||||
{
|
||||
if [ -s $1 ]; then
|
||||
if [ "$(ps -p `cat $1` | wc -l)" -gt 1 ]; then
|
||||
return 1 #false
|
||||
fi
|
||||
getlock() {
|
||||
if [ -s $1 ]; then
|
||||
if [ "$(ps -p $(cat $1) | wc -l)" -gt 1 ]; then
|
||||
return 1 #false
|
||||
fi
|
||||
|
||||
echo $$ >"$1"
|
||||
return 0 #true
|
||||
fi
|
||||
|
||||
echo $$ >"$1"
|
||||
return 0 #true
|
||||
}
|
||||
|
||||
freelock()
|
||||
{
|
||||
rm "$1"
|
||||
rm "$CHANGE_FILE"
|
||||
freelock() {
|
||||
rm "$1"
|
||||
rm "$CHANGE_FILE"
|
||||
}
|
||||
|
||||
|
||||
if [ $# -eq 1 ] ; then
|
||||
m_info "Initialising Osmosis replication system to $1"
|
||||
mkdir $WORKOSM_DIR
|
||||
$OSMOSIS_BIN --read-replication-interval-init workingDirectory=$WORKOSM_DIR 1>&2 2> "$OSMOSISLOG"
|
||||
wget "http://replicate-sequences.osm.mazdermind.de/?"$1"T00:00:00Z" -O $WORKOSM_DIR/state.txt
|
||||
mv $WORKOSM_DIR/configuration.txt $WORKOSM_DIR/configuration_orig.txt
|
||||
sed "s!baseUrl=http://planet.openstreetmap.org/replication/minute!baseUrl=https://planet.openstreetmap.org/replication/minute!" $WORKOSM_DIR/configuration_orig.txt > $WORKOSM_DIR/configuration.txt
|
||||
if [ $# -eq 1 ]; then
|
||||
m_info "Initialising Osmosis replication system to $1"
|
||||
mkdir $WORKOSM_DIR
|
||||
$OSMOSIS_BIN --read-replication-interval-init workingDirectory=$WORKOSM_DIR 1>&2 2>"$OSMOSISLOG"
|
||||
wget "http://replicate-sequences.osm.mazdermind.de/?"$1"T00:00:00Z" -O $WORKOSM_DIR/state.txt
|
||||
mv $WORKOSM_DIR/configuration.txt $WORKOSM_DIR/configuration_orig.txt
|
||||
sed "s!baseUrl=http://planet.openstreetmap.org/replication/minute!baseUrl=https://planet.openstreetmap.org/replication/minute!" $WORKOSM_DIR/configuration_orig.txt >$WORKOSM_DIR/configuration.txt
|
||||
else
|
||||
# make sure the lockfile is removed when we exit and then claim it
|
||||
# make sure the lockfile is removed when we exit and then claim it
|
||||
|
||||
if ! getlock "$LOCK_FILE"; then
|
||||
m_info "pid `cat $LOCK_FILE` still running"
|
||||
exit 3
|
||||
fi
|
||||
if ! getlock "$LOCK_FILE"; then
|
||||
m_info "pid $(cat $LOCK_FILE) still running"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
if [ -e $STOP_FILE ]; then
|
||||
m_info "stopped"
|
||||
exit 2
|
||||
fi
|
||||
if [ -e $STOP_FILE ]; then
|
||||
m_info "stopped"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Add disk space check from https://github.com/zverik/regional
|
||||
# -----------------------------------------------------------------------------
|
||||
MIN_DISK_SPACE_MB=500
|
||||
# -----------------------------------------------------------------------------
|
||||
# Add disk space check from https://github.com/zverik/regional
|
||||
# -----------------------------------------------------------------------------
|
||||
MIN_DISK_SPACE_MB=500
|
||||
|
||||
if `python -c "import os, sys; st=os.statvfs('$BASE_DIR'); sys.exit(1 if st.f_bavail*st.f_frsize/1024/1024 > $MIN_DISK_SPACE_MB else 0)"`; then
|
||||
if $(python -c "import os, sys; st=os.statvfs('$BASE_DIR'); sys.exit(1 if st.f_bavail*st.f_frsize/1024/1024 > $MIN_DISK_SPACE_MB else 0)"); then
|
||||
m_info "there is less than $MIN_DISK_SPACE_MB MB left"
|
||||
exit 4
|
||||
fi
|
||||
fi
|
||||
|
||||
seq=`cat $WORKOSM_DIR/state.txt | grep sequenceNumber | cut -d= -f2`
|
||||
seq=$(cat $WORKOSM_DIR/state.txt | grep sequenceNumber | cut -d= -f2)
|
||||
|
||||
m_ok "start import from seq-nr $seq, replag is `osmosis-db_replag -h`"
|
||||
m_ok "start import from seq-nr $seq, replag is $(osmosis-db_replag -h)"
|
||||
|
||||
/bin/cp $WORKOSM_DIR/state.txt $WORKOSM_DIR/last.state.txt
|
||||
m_ok "downloading diff"
|
||||
|
||||
if ! $OSMOSIS_BIN --read-replication-interval workingDirectory=$WORKOSM_DIR --simplify-change --write-xml-change $CHANGE_FILE 1>&2 2> "$OSMOSISLOG"; then
|
||||
m_error "Osmosis error"
|
||||
fi
|
||||
|
||||
m_ok "filtering diff"
|
||||
if ! $TRIM_BIN $TRIM_OPTIONS $TRIM_REGION_OPTIONS -z $CHANGE_FILE $CHANGE_FILE 1>&2 2>> "$RUNLOG"; then
|
||||
/bin/cp $WORKOSM_DIR/state.txt $WORKOSM_DIR/last.state.txt
|
||||
m_ok "downloading diff"
|
||||
|
||||
if ! $OSMOSIS_BIN --read-replication-interval workingDirectory=$WORKOSM_DIR --simplify-change --write-xml-change $CHANGE_FILE 1>&2 2>"$OSMOSISLOG"; then
|
||||
m_error "Osmosis error"
|
||||
fi
|
||||
|
||||
m_ok "filtering diff"
|
||||
if ! $TRIM_BIN $TRIM_OPTIONS $TRIM_REGION_OPTIONS -z $CHANGE_FILE $CHANGE_FILE 1>&2 2>>"$RUNLOG"; then
|
||||
m_error "Trim_osc error"
|
||||
fi
|
||||
fi
|
||||
|
||||
m_ok "importing diff"
|
||||
#------------------------------------------------------------------------------
|
||||
# Previously openstreetmap-tiles-update-expire tried to dirty layer
|
||||
# "$EXPIRY_MAXZOOM - 3" (which was 15) only. Instead we write all expired
|
||||
# tiles in range to the list (note the "-" rather than ":" in the "-e"
|
||||
# parameter).
|
||||
#------------------------------------------------------------------------------
|
||||
if ! $OSM2PGSQL_BIN -a --slim -e$EXPIRY_MINZOOM-$EXPIRY_MAXZOOM $OSM2PGSQL_OPTIONS -o "$EXPIRY_FILE.$$" $CHANGE_FILE 1>&2 2> "$PGSQLLOG"; then
|
||||
m_error "osm2pgsql error"
|
||||
fi
|
||||
m_ok "importing diff"
|
||||
#------------------------------------------------------------------------------
|
||||
# Previously openstreetmap-tiles-update-expire tried to dirty layer
|
||||
# "$EXPIRY_MAXZOOM - 3" (which was 15) only. Instead we write all expired
|
||||
# tiles in range to the list (note the "-" rather than ":" in the "-e"
|
||||
# parameter).
|
||||
#------------------------------------------------------------------------------
|
||||
if ! $OSM2PGSQL_BIN -a --slim -e$EXPIRY_MINZOOM-$EXPIRY_MAXZOOM $OSM2PGSQL_OPTIONS -o "$EXPIRY_FILE.$$" $CHANGE_FILE 1>&2 2>"$PGSQLLOG"; then
|
||||
m_error "osm2pgsql error"
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# The lockfile is normally removed before we expire tiles because that is
|
||||
# something thatcan be done in parallel with further processing. In order to
|
||||
# avoid rework, if actually rerendering is done rather than just deleting or
|
||||
# dirtying, it makes sense to move it lower down.
|
||||
#------------------------------------------------------------------------------
|
||||
# m_ok "Import complete; removing lock file"
|
||||
# freelock "$LOCK_FILE"
|
||||
#------------------------------------------------------------------------------
|
||||
# The lockfile is normally removed before we expire tiles because that is
|
||||
# something thatcan be done in parallel with further processing. In order to
|
||||
# avoid rework, if actually rerendering is done rather than just deleting or
|
||||
# dirtying, it makes sense to move it lower down.
|
||||
#------------------------------------------------------------------------------
|
||||
# m_ok "Import complete; removing lock file"
|
||||
# freelock "$LOCK_FILE"
|
||||
|
||||
m_ok "expiring tiles"
|
||||
#------------------------------------------------------------------------------
|
||||
# When expiring tiles we need to define the style sheet if it's not "default".
|
||||
# In this case it's "ajt".
|
||||
# Previously all tiles on the "dirty" list between $EXPIRY_MINZOOM and
|
||||
# $EXPIRY_MAXZOOM were dirtied. We currently re-render
|
||||
# tiles >= $EXPIRY_MINZOOM and < $EXPIRY_DELETEFROM, expiry from 14 and
|
||||
# delete >= $EXPIRY_DELETEFROM and <= $EXPIRY_MAXZOOM.
|
||||
# The default path to renderd.sock is fixed.
|
||||
#
|
||||
# Note no --touch-from=$EXPIRY_TOUCHFROM
|
||||
#------------------------------------------------------------------------------
|
||||
if ! render_expired --map=ajt --min-zoom=$EXPIRY_MINZOOM --delete-from=$EXPIRY_DELETEFROM --max-zoom=$EXPIRY_MAXZOOM -s /var/run/renderd/renderd.sock < "$EXPIRY_FILE.$$" 2>&1 | tail -8 >> "$EXPIRYLOG"; then
|
||||
m_info "Expiry failed"
|
||||
fi
|
||||
m_ok "expiring tiles"
|
||||
#------------------------------------------------------------------------------
|
||||
# When expiring tiles we need to define the style sheet if it's not "default".
|
||||
# In this case it's "ajt".
|
||||
# Previously all tiles on the "dirty" list between $EXPIRY_MINZOOM and
|
||||
# $EXPIRY_MAXZOOM were dirtied. We currently re-render
|
||||
# tiles >= $EXPIRY_MINZOOM and < $EXPIRY_DELETEFROM, expiry from 14 and
|
||||
# delete >= $EXPIRY_DELETEFROM and <= $EXPIRY_MAXZOOM.
|
||||
# The default path to renderd.sock is fixed.
|
||||
#
|
||||
# Note no --touch-from=$EXPIRY_TOUCHFROM
|
||||
#------------------------------------------------------------------------------
|
||||
if ! render_expired --map=ajt --min-zoom=$EXPIRY_MINZOOM --delete-from=$EXPIRY_DELETEFROM --max-zoom=$EXPIRY_MAXZOOM -s /var/run/renderd/renderd.sock <"$EXPIRY_FILE.$$" 2>&1 | tail -8 >>"$EXPIRYLOG"; then
|
||||
m_info "Expiry failed"
|
||||
fi
|
||||
|
||||
rm "$EXPIRY_FILE.$$"
|
||||
rm "$EXPIRY_FILE.$$"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Only remove the lock file after expiry (if system is slow we want to delay
|
||||
# the next import, not have multiple render_expired processes running)
|
||||
#------------------------------------------------------------------------------
|
||||
freelock "$LOCK_FILE"
|
||||
|
||||
m_ok "Done with import"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Only remove the lock file after expiry (if system is slow we want to delay
|
||||
# the next import, not have multiple render_expired processes running)
|
||||
#------------------------------------------------------------------------------
|
||||
freelock "$LOCK_FILE"
|
||||
|
||||
|
||||
m_ok "Done with import"
|
||||
|
||||
fi
|
||||
|
@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -9,32 +11,35 @@
|
||||
# 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/.
|
||||
|
||||
#!/bin/bash
|
||||
STATE=/var/cache/renderd/tiles/.osmosis/state.txt
|
||||
|
||||
rep=`cat ${STATE} |\
|
||||
grep 'timestamp' |\
|
||||
awk '{split($0, a, "="); print a[2]}' |\
|
||||
tr 'T' ' ' |\
|
||||
xargs -I{} ${BINPATH}date --utc --date "{}" +%s`
|
||||
is=`date --utc +%s`
|
||||
rep=$(cat ${STATE} |
|
||||
grep 'timestamp' |
|
||||
awk '{split($0, a, "="); print a[2]}' |
|
||||
tr 'T' ' ' |
|
||||
xargs -I{} ${BINPATH}date --utc --date "{}" +%s)
|
||||
is=$(date --utc +%s)
|
||||
|
||||
lag=$(($is - $rep))
|
||||
|
||||
if [ "$1" = "-h" ]; then
|
||||
|
||||
if [ $lag -gt 86400 ]; then echo $(($lag / 86400)) "day(s) and" $((($lag % 86400) / 3600)) "hour(s)";
|
||||
elif [ $lag -gt 3600 ]; then echo $(($lag / 3600)) "hour(s)";
|
||||
elif [ $lag -gt 60 ]; then echo $(($lag / 60)) "minute(s)";
|
||||
else echo $lag "second(s)";
|
||||
if [ $lag -gt 86400 ]; then
|
||||
echo $(($lag / 86400)) "day(s) and" $((($lag % 86400) / 3600)) "hour(s)"
|
||||
elif [ $lag -gt 3600 ]; then
|
||||
echo $(($lag / 3600)) "hour(s)"
|
||||
elif [ $lag -gt 60 ]; then
|
||||
echo $(($lag / 60)) "minute(s)"
|
||||
else
|
||||
echo $lag "second(s)"
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
echo $lag;
|
||||
echo $lag
|
||||
|
||||
fi
|
||||
fi
|
||||
|
@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
@ -9,13 +11,13 @@
|
||||
# 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/.
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
for z in `seq 0 18`
|
||||
do
|
||||
(cd $z; ../../render_old -z $z -Z $z &> render.txt) &
|
||||
for z in $(seq 0 18); do
|
||||
(
|
||||
cd $z
|
||||
../../render_old -z $z -Z $z &>render.txt
|
||||
) &
|
||||
done
|
||||
|
Reference in New Issue
Block a user