unRAID supports multiple notification platforms for keeping you informed about what the server is doing, the only problem is, I don’t use any of those notification platforms. I have however started using ntfy.sh, which has been working well for my home assistant notifications, and is a very simple platform. What I’d like to do is integrate it into unRAID so that I can make use of it there as well.
unRAID has the ability to send notifications to many different agents. These are all controlled by scripts in a specific folder, allowing it to send notifications to all enabled agents via their scripts. The location of the notification agent script folder is below.
/boot/config/plugins/dynamix/notifications/agents/
I created the ntfy script in the folder and added the following to it’s contents. Make sure you don’t use a file extension on the script, else it won’t work.
#!/bin/bash
#curl -u "user:pass"
curl -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.sh/unRAID
I then went to the unRAID “Settings” menu, “Notifications” and the “Notification Settings”section. Here turn on the agent option for any notification types that you want sent through ntfy.
With the agent option enabled, the ntfy script will be called and you’ll get notifications through the platform. This worked well for getting me better insight into my server’s status.