#! /bin/sh set -eu PORT=${PORT:-23} HOST=${HOST:-$USERNAME.your-storagebox.de} ssh -p${PORT} ${USERNAME}@${HOST} df -k | tail -n +2 | while read FS TOTAL USED AVAIL PERCENT MOUNT; do echo "# HELP hetzner_storage_available Available storage in kilobytes" echo "# TYPE hetzner_storage_available gauge" echo "hetzner_storage_available{host=\"${HOST}\"} $AVAIL" echo "# HELP hetzner_storage_used Used storage in kilobytes" echo "# TYPE hetzner_storage_used gauge" echo "hetzner_storage_used{host=\"${HOST}\"} $USED" echo "# HELP hetzner_storage_total Total storage in kilobytes" echo "# TYPE hetzner_storage_total gauge" echo "hetzner_storage_total{host=\"${HOST}\"} $TOTAL" done