Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ntfy notification support to ZED #15584

Merged
merged 1 commit into from Dec 1, 2023
Merged

Conversation

slash2314
Copy link
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

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.

Signed-off-by: Dex Wood <slash2314@gmail.com>
@slash2314 slash2314 marked this pull request as ready for review November 27, 2023 03:04
@behlendorf behlendorf added Component: ZED ZFS Event Daemon Status: Code Review Needed Ready for review and testing labels Nov 27, 2023
Copy link

@classabbyamp classabbyamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm interested in using this and the code seems reasonable.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Dec 1, 2023
@behlendorf behlendorf merged commit 014265f into openzfs:master Dec 1, 2023
22 of 26 checks passed
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Dec 12, 2023
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.

Reviewed-by: @classabbyamp 
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Dex Wood <slash2314@gmail.com>
Closes openzfs#15584
@shumvgolove shumvgolove mentioned this pull request Feb 9, 2024
13 tasks
tonyhutter pushed a commit that referenced this pull request Feb 22, 2024
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.

Reviewed-by: @classabbyamp
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Dex Wood <slash2314@gmail.com>
Closes #15584
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ZED ZFS Event Daemon Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants