From db644edfd685c13d8fd51027569615202d872510 Mon Sep 17 00:00:00 2001 From: Tobias Strobel Date: Thu, 12 Aug 2021 18:56:42 +0200 Subject: [PATCH] Add smartmontools gotify notify script --- helios/smartmontools-notify-gotify.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 helios/smartmontools-notify-gotify.sh diff --git a/helios/smartmontools-notify-gotify.sh b/helios/smartmontools-notify-gotify.sh new file mode 100644 index 0000000..b2d5d57 --- /dev/null +++ b/helios/smartmontools-notify-gotify.sh @@ -0,0 +1,11 @@ +#!/bin/bash -e +# smartd Gotify Notification script, placed in /etc/smartmontools/run.d/99gotify +# See: https://manpages.debian.org/testing/smartmontools/smartd.conf.5.en.html for available ENV vars + +# Send gotify noticication /usr/bin/curl exists +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.strobeto.de/message?token=AR12Hu7_7XDZ4Hf" -F "title=[$(hostname)] smartd $SMARTD_FAILTYPE ($SMARTD_DEVICESTRING)" -F "message=$SMARTD_MESSAGE" -F "priority=8"