|
@@ -1,10 +1,12 @@
|
|
|
#!/bin/bash
|
|
|
|
|
|
+# Exit if no Prometheus Pushgateway URL is defined
|
|
|
[ -z "$PROM_URL" ] && exit
|
|
|
|
|
|
+# Get latest backup status as json
|
|
|
json=`borg info --last 1 --json`
|
|
|
|
|
|
-
|
|
|
+# Parse json in the Prometheus exposition formatand and transmit
|
|
|
cat <<EOF | curl --data-binary @- $PROM_URL
|
|
|
# TYPE borg_run_duration_seconds gauge
|
|
|
# HELP borg_run_duration_seconds duration between start and end
|