source: other-projects/tipple-android/osmosis/script/munin/osm_replication_lag@ 26899

Last change on this file since 26899 was 26899, checked in by davidb, 11 years ago

Tipple reborn after Chris's Summer of Code 2013

File size: 791 bytes
Line 
1#!/bin/sh
2# -*- sh -*-
3
4# load the munin plugin helper
5. $MUNIN_LIBDIR/plugins/plugin.sh
6
7# if no workingDirectory has been configures
8if [ ! $workingDirectory ]; then
9 # exit with an error
10 echo "no workingDirectory configured" >&2
11 exit 1
12fi
13
14# path to osmosis binary
15[ $osmosis ] || osmosis="osmosis"
16
17# configuration section
18if [ "$1" = "config" ]; then
19
20 echo 'graph_title OSM PostGIS Database Replag'
21 echo 'graph_args --base 1000'
22 echo 'graph_vlabel seconds behind main database'
23 echo 'graph_category osm'
24
25 echo 'lag.label replication lag'
26 echo 'lag.draw LINE'
27
28 exit 0
29fi
30
31# invoke osmosis to calculate the replication lag
32lag=$($osmosis --read-replication-lag workingDirectory="$workingDirectory" 2>/dev/null)
33echo "lag.value $lag"
34
35exit 0
Note: See TracBrowser for help on using the repository browser.