#!/usr/bin/env bash # DO NOT EDIT - This file is being maintained by Chef # # Based on: https://github.com/drolbr/Overpass-API/blob/way_based_areas/munin/osm_replication_lag-api if [ "$1" = "config" ]; then echo 'graph_title DB Lag' echo 'graph_args --base 1000' echo 'graph_vlabel minutes behind main database' echo 'graph_category overpass' echo 'lag.label replication lag' echo 'lag.draw LINE' echo 'lag.cdef lag,60,/' echo 'lag.critical 1000' exit 0 fi lag=$(($(date +%s)-$(date +%s --utc -d "$(cat <%= @basedir %>/db/osm_base_version | cut -f2 -d\" | sed s/"\\\\"/""/g | sed s/[ZT]/" "/g)" ))) echo "lag.value $lag"