From d62928aaaee42e19317aba13ee78908130254447 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Tue, 24 May 2022 15:15:37 -0700 Subject: [PATCH] adding documentation for script based notifications. --- README.md | 4 +++- docs/TROUBLESHOOTING_NOTIFICATIONS.md | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 docs/TROUBLESHOOTING_NOTIFICATIONS.md diff --git a/README.md b/README.md index 12aba49..9d0a066 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,9 @@ Scrutiny supports sending SMART device failure notifications via the following s - Telegram - Tulip -Check the `notify.urls` section of [example.scrutiny.yml](example.scrutiny.yaml) for more information and documentation for service specific setup. +Check the `notify.urls` section of [example.scrutiny.yml](example.scrutiny.yaml) for examples. + +For more information and troubleshooting, see the [TROUBLESHOOTING_NOTIFICATIONS.md](./docs/TROUBLESHOOTING_NOTIFICATIONS.md) file ### Testing Notifications diff --git a/docs/TROUBLESHOOTING_NOTIFICATIONS.md b/docs/TROUBLESHOOTING_NOTIFICATIONS.md new file mode 100644 index 0000000..2baba6a --- /dev/null +++ b/docs/TROUBLESHOOTING_NOTIFICATIONS.md @@ -0,0 +1,25 @@ +# Notifications + +As documented in [example.scrutiny.yaml](https://github.com/AnalogJ/scrutiny/blob/master/example.scrutiny.yaml#L59-L75) +there are multiple ways to configure notifications for Scrutiny. + +Under the hood we use a library called [Shoutrrr](https://github.com/containrrr/shoutrrr) to send our notifications, and you should use their documentation if you run into +any issues: https://containrrr.dev/shoutrrr/services/overview/ + + +# Script Notifications + +While the Shoutrrr library supports many popular providers for sending notifications Scrutiny also supports a "script" based +notification system, allowing you to execute a custom script whenever a notification needs to be sent. +Data is provided to this script using the following environmental variables: + +``` +SCRUTINY_SUBJECT - eg. "Scrutiny SMART error (%s) detected on device: %s" +SCRUTINY_DATE +SCRUTINY_FAILURE_TYPE - EmailTest, SmartFail, ScrutinyFail +SCRUTINY_DEVICE_NAME - eg. /dev/sda +SCRUTINY_DEVICE_TYPE - ATA/SCSI/NVMe +SCRUTINY_DEVICE_SERIAL - eg. WDDJ324KSO +SCRUTINY_MESSAGE - eg. "Scrutiny SMART error notification for device: %s\nFailure Type: %s\nDevice Name: %s\nDevice Serial: %s\nDevice Type: %s\nDate: %s" +``` +