jlaning Posted October 4, 2022 Share Posted October 4, 2022 (edited) There are notification agents that aren't included in unRAID, ntfy.sh for example. It would be great if one of the notification agents could just be a user script, or multiple. This way you could write your own notification command and not have to wait for your preferred agent to be added officially. Then you user script could be something along the lines of (for ntfy.sh): curl \ -H "Title: $UNRAID_NOTIF_SUBJECT" \ -H "Priority: default" \ -H "Tags: unRAID" \ -d "$UNRAID_NOTIF_DESC" \ ntfy.sh/unraid_notifs where there are a defined list of environment variables passed to it such as: UNRAID_NOTIF_SUBJECT UNRAID_NOTIF_EVENT UNRAID_NOTIF_TIMESTAMP UNRAID_NOTIF_DESC UNRAID_NOTIF_IMPORTANCE UNRAID_NOTIF_CONTENT UNRAID_NOTIF_LINK ... Edited October 4, 2022 by jlaning 2 Quote Link to comment
jlaning Posted October 4, 2022 Author Share Posted October 4, 2022 (edited) After some initial investigation, it seems that at least maybe dropping a custom script into the directory /boot/config/plugins/dynamix/notifications/agents/ would work based on the code in /usr/local/emhttp/plugins/dynamix/scripts/notify but I haven't tested this. However, a UI way of doing this would be preferred. EDIT: Creating a script /boot/config/plugins/dynamix/notifications/agents/ntfy worked (as a temp solution). Here's my example for ntfy.sh #!/bin/bash curl -u "user:pass" \ -H "Title: ${SUBJECT}" \ -H "Tags: unRAID" \ -d "Event: ${EVENT} Subject: ${SUBJECT} Description: ${DESCRIPTION} Importance: ${IMPORTANCE} Time: $(date '+%Y-%m-%d %H:%M:%S') ${CONTENT}" \ https://ntfy.domain.tld/unRAID Edited October 4, 2022 by jlaning added temporary solution 2 3 Quote Link to comment
nlz Posted October 17, 2022 Share Posted October 17, 2022 +1 on this, want to use ntfy. 1 Quote Link to comment
Iceman24 Posted February 10, 2023 Share Posted February 10, 2023 +1 on adding nftfy. Quote Link to comment
-Daedalus Posted February 13, 2023 Share Posted February 13, 2023 +1 for this too. I'm dumping stuff into syslog at the moment, but UI pop-ups would be sweet. Quote Link to comment
Iceman24 Posted February 17, 2023 Share Posted February 17, 2023 On 10/4/2022 at 4:09 PM, jlaning said: After some initial investigation, it seems that at least maybe dropping a custom script into the directory /boot/config/plugins/dynamix/notifications/agents/ would work based on the code in /usr/local/emhttp/plugins/dynamix/scripts/notify but I haven't tested this. However, a UI way of doing this would be preferred. EDIT: Creating a script /boot/config/plugins/dynamix/notifications/agents/ntfy worked (as a temp solution). Here's my example for ntfy.sh #!/bin/bash curl -u "user:pass" \ -H "Title: ${SUBJECT}" \ -H "Tags: unRAID" \ -d "Event: ${EVENT} Subject: ${SUBJECT} Description: ${DESCRIPTION} Importance: ${IMPORTANCE} Time: $(date '+%Y-%m-%d %H:%M:%S') ${CONTENT}" \ https://ntfy.domain.tld/unRAID Are you saying that you got it working with that script? Quote Link to comment
semaj4712 Posted March 2, 2023 Share Posted March 2, 2023 Was anybody else able to make this work? I do not have a folder notifications in dynamix, but I could potentially create one Quote Link to comment
semaj4712 Posted March 5, 2023 Share Posted March 5, 2023 (edited) So upon further review this totally works, if the folder does not exist just create it, you can also name the .sh file pretty much anything you want. I also updated it a bit for nicer looking notifications #!/bin/bash ntfy_url="https://ntfy.sh/topic" # Use ntfy_username and ntfy_password OR ntfy_token ntfy_username="" ntfy_password="" ntfy_token="" # Leave empty if you do not want an icon. ntfy_icon="https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/png/unraid.png" if [[ -n $ntfy_password && -n $ntfy_token ]]; then echo "Use ntfy_username and ntfy_password OR ntfy_token" exit 1 elif [ -n "$ntfy_password" ]; then ntfy_base64=$( echo -n "$ntfy_username:$ntfy_password" | base64 ) ntfy_auth="Authorization: Basic $ntfy_base64" elif [ -n "$ntfy_token" ]; then ntfy_auth="Authorization: Bearer $ntfy_token" else ntfy_auth="" fi ntfy_title="Unraid: ${SUBJECT}" ntfy_message="${DESCRIPTION}" if [ "${IMPORTANCE}" == "alert" ]; then ntfy_tag=rotating_light ntfy_priority="urgent" ntfy_xpriority=5 elif [ "${IMPORTANCE}" == "warning" ]; then ntfy_tag=warning ntfy_priority="high" ntfy_xpriority=4 else ntfy_tag=information_source ntfy_priority="default" ntfy_xpriority=3 fi curl $ntfy_url \ -H "$ntfy_auth" \ -H "tags:"$ntfy_tag \ -H "X-Title: $ntfy_title" \ -H "X-Icon: $ntfy_icon" \ -H "Priority: $ntfy_priority" \ -H "X-Priority: $ntfy_xpriority" \ -d "$ntfy_message" \ Edited March 6, 2023 by semaj4712 3 Quote Link to comment
steff94 Posted July 15, 2023 Share Posted July 15, 2023 (edited) +1 for official ntfy.sh notifications Edited July 15, 2023 by steff94 Quote Link to comment
Blockblue47 Posted October 13, 2023 Share Posted October 13, 2023 +1 for ntfy notifications as well as it's been promoted as a great self-hosted notification solution. I currently use it and would love for it to be integrated into Unraid notifications. 1 Quote Link to comment
ich777 Posted October 17, 2023 Share Posted October 17, 2023 I hope this is what you where after: Already created a PR and will be hopefully included in one of the next releases. 4 Quote Link to comment
macronin Posted December 21, 2023 Share Posted December 21, 2023 I just want to add a note that may help keep anyone else from going down the Rabbit-hole that caught me. The file path to install the NTFY agent that is on this page is correct. But the one in the built-in help of the Notifications settings page is incorrect (as of 2023-1221 v 6.12.6) This page has - /boot/config/plugins/dynamix/notifications/agents/ Help on notifications page has - /boot/config/plugins/dynamix/notification/agents/ The only difference is that the correct value is plural while the Help doc has singular "notifications" vs "notification" That one little letter drove me crazy for a while. :-) Quote Link to comment
ich777 Posted December 21, 2023 Share Posted December 21, 2023 22 minutes ago, macronin said: The file path to install the NTFY agent that is on this page is correct. But the one in the built-in help of the Notifications settings page is incorrect (as of 2023-1221 v 6.12.6) NTFY should be an agent by default and you don't have to do anything as the post above yours imply. Quote Link to comment
macronin Posted December 21, 2023 Share Posted December 21, 2023 8 minutes ago, ich777 said: NTFY should be an agent by default and you don't have to do anything as the post above yours imply. The post above mine talks about a submitted update that has not gone live yet (as far as I can tell). I had checked all the options on myidentifier.myunraid.net/Settings/Notifications page and NTFY is not listed as of yet. It might be in the nightly version (for future public release) but I am running Stable 6.12.6 which is the latest general usage version. Umm, just realized tat you are the author of the post above me. :-) Is this maybe in a diff location that I may haver missed? Quote Link to comment
nlz Posted December 21, 2023 Share Posted December 21, 2023 I haven't seen it natively in the options yet either. Quote Link to comment
ich777 Posted December 21, 2023 Share Posted December 21, 2023 20 minutes ago, macronin said: Umm, just realized tat you are the author of the post above me. 🙂 Is this maybe in a diff location that I may haver missed? 10 minutes ago, nlz said: I haven't seen it natively in the options yet either. Oh sorry, I've pushed that against master that should be 6.13.0 and not 6.12.x Quote Link to comment
macronin Posted December 21, 2023 Share Posted December 21, 2023 13 minutes ago, ich777 said: Oh sorry, I've pushed that against master that should be 6.13.0 and not 6.12.x No problem. I'll keep an eye out for it. I appreciate you adding it. Quote Link to comment
MP715 Posted January 24 Share Posted January 24 (edited) On 10/17/2023 at 4:26 AM, ich777 said: I hope this is what you where after: Already created a PR and will be hopefully included in one of the next releases. I can't seem to get this to appear. I followed all the steps. Is a reboot required to read the script from: /boot/config/plugins/dynamix/notifications/agents EDIT: just noticed the version is 6.13 and i'm on 6.12.6 Edited January 24 by MP715 Quote Link to comment
ich777 Posted January 24 Share Posted January 24 9 minutes ago, MP715 said: just noticed the version is 6.13 and i'm on 6.12.6 This is included in the next stable release. 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.