Add Ntfy notification support to ZED #15584
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds the zed_notify_ntfy() function and hooks it into zed_notify(). This will allow ZED to send notifications to ntfy.sh or a self-hosted Ntfy service, which can be received on a desktop or mobile device. It is configured with ZED_NTFY_TOPIC, ZED_NTFY_URL, and ZED_NTFY_ACCESS_TOKEN variables in zed.rc.
Motivation and Context
These changes will allow for users of Ntfy to utilize push notifications from ZED, similar to Pushbullet. The ability to self-host Ntfy and flexibility with ntfy.sh in general, will provide options for receiving notifications related to ZFS through ZED.
Description
The changes in this pull request involve modifications to zed-functions.sh and zed.rc, providing the zed_notify_ntfy function and hooks into zed_notify within zed-functions.sh. It also involves adding relevant variables into zed.rc that can be used to configure the behavior of zed_notify_ntfy.
How Has This Been Tested?
I have incorporated the changes into my local ZFS installation and tested ZED notifications directed at ntfy.sh, a self-hosted Ntfy service, and both of these with and without access tokens. Since the variables do not overlap with other services, this pull request should not disrupt other notification services and options.
Types of changes
Checklist:
Signed-off-by
.