Add notify hook 'ntfy' for smartd

This commit is contained in:
Tobias Strobel 2022-12-25 22:21:22 +01:00
parent 61735e1812
commit 9a0c3bb30b

10
smartd-exec-ntfy.sh Normal file
View file

@ -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"