]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/files/default/plugins/replication_delay
Add a new Squid graph to count the IPs being delayed due to no-referer, and restrict...
[chef.git] / cookbooks / munin / files / default / plugins / replication_delay
index e88ae97a1358e84cefc8a91ad082712e7a76f34f..f1761e84d34143fd947ceba93349fe3776e9ae80 100755 (executable)
@@ -17,12 +17,15 @@ if [ "$1" = "config" ]; then
         echo 'age.label DB import age' 
         echo 'age.type GAUGE' 
        echo 'age.cdef age,60,/'
+       echo 'age.warning :600'
+       echo 'age.critical :3600'
         exit 0 
 fi 
-tstamp=`sed -e '/^timestamp=/!d' -e 's/.*=//' -e 's/Z//' -e 's/T/Z/' -e 's/\\\\//' -e 's/\\\\//' -e q /home/jburgess/replicate/state.txt` 
+
+state=${state:-/home/jburgess/replicate/state.txt}
+tstamp=`sed -e '/^timestamp=/!d' -e 's/.*=//' -e 's/Z//' -e 's/T/Z/' -e 's/\\\\//' -e 's/\\\\//' -e q ${state}` 
 tstampsec=`date --date=$tstamp +%s` 
 nowsec=`date +%s` 
  
  
-echo "age.value " `expr $nowsec - $tstampsec`
\ No newline at end of file
+echo "age.value " `expr $nowsec - $tstampsec`