From 9a0c3bb30b98c2b562c5e4e48b07bf7332b7b888 Mon Sep 17 00:00:00 2001 From: Tobias Strobel Date: Sun, 25 Dec 2022 22:21:22 +0100 Subject: [PATCH] Add notify hook 'ntfy' for smartd --- smartd-exec-ntfy.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 smartd-exec-ntfy.sh diff --git a/smartd-exec-ntfy.sh b/smartd-exec-ntfy.sh new file mode 100644 index 0000000..ae72de3 --- /dev/null +++ b/smartd-exec-ntfy.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh +# smartd ntfy notification script, placed in /etc/smartmontools/run.d/99ntfy (for Debian) +# See: https://manpages.debian.org/testing/smartmontools/smartd.conf.5.en.html for available ENV vars + +if ! [ -x /usr/bin/curl ]; then + echo "Your system does not have /usr/bin/curl. Install the curl package" + exit 1 +fi + +curl -fsS -m 10 --retry 5 -o /dev/null "https://push.rafe.li/helios-smartd" -H "Title: [$(hostname)] smartd $SMARTD_FAILTYPE ($SMARTD_DEVICESTRING)" -H "Priority: high" -d "$SMARTD_MESSAGE" \ No newline at end of file