summaryrefslogtreecommitdiff
path: root/roles/storage/zfs/syncoid/templates/syncoid_finalize.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/storage/zfs/syncoid/templates/syncoid_finalize.j2')
-rw-r--r--roles/storage/zfs/syncoid/templates/syncoid_finalize.j27
1 files changed, 6 insertions, 1 deletions
diff --git a/roles/storage/zfs/syncoid/templates/syncoid_finalize.j2 b/roles/storage/zfs/syncoid/templates/syncoid_finalize.j2
index 3869e975..638781ac 100644
--- a/roles/storage/zfs/syncoid/templates/syncoid_finalize.j2
+++ b/roles/storage/zfs/syncoid/templates/syncoid_finalize.j2
@@ -42,6 +42,11 @@ syncoid_pull_run{backup_server="{{ inventory_hostname }}"} $now
syncoid_pull_duration_seconds{backup_server="{{ inventory_hostname }}"} $duration
EOF
+if [ "$#" -eq 0 ]; then
+ echo "not transferring prometheus metrics."
+ exit $ret
+fi
+
if [ -z "$1" ] || [ -z "$2" ] || [ "$1" == "--" ] || [ "$2" == "--" ]; then
echo "$0 <host> <textfile-collector-path> [ -- <additional ssh arguments .. > ]"
@@ -58,7 +63,7 @@ if [ -n "$1" ]; then
shift
fi
-echo "transfering prometheus metrics to: $report_to:$textfile_collector_path"
+echo "transferring prometheus metrics to: $report_to:$textfile_collector_path"
cat "$RUNTIME_DIRECTORY/metrics" | ssh -o "UserKnownHostsFile=/var/lib/syncoid/ssh.knownhosts" -o "HashKnownHosts=no" -i "/var/lib/syncoid/id_ssh_ed25519" "$@" "$report_to" "cat > '$textfile_collector_path/syncoid-pull-{{ inventory_hostname }}.prom'"
exit $ret