osm_db_request_count 1.0 KB

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env bash
  2. # If you want munin monitoring then please copy this file to /etc/munin/plugins
  3. if [[ "$1" = "config" ]]; then
  4. {
  5. echo 'graph_title Overpass API request count'
  6. echo 'graph_vlabel per minute'
  7. echo "overpass_request_started.label started"
  8. echo "overpass_request_started.type COUNTER"
  9. echo "overpass_request_started.cdef overpass_request_started,60,*"
  10. echo "overpass_request_started.max 10000"
  11. echo "overpass_request_completed.label completed"
  12. echo "overpass_request_completed.type COUNTER"
  13. echo "overpass_request_completed.cdef overpass_request_completed,60,*"
  14. echo "overpass_request_completed.max 10000"
  15. exit 0
  16. }; fi
  17. STARTED=`/OVERPASS_EXEC_DIR/bin/dispatcher --osm-base --status | grep -E '^Counter of started' | awk '{ print $5; }'` # adapt directory
  18. echo "overpass_request_started.value $STARTED"
  19. COMPLETED=`/OVERPASS_EXEC_DIR/bin/dispatcher --osm-base --status | grep -E '^Counter of finished' | awk '{ print $5; }'` # adapt directory
  20. echo "overpass_request_completed.value $COMPLETED"