jedimstr Posted July 31, 2016 Share Posted July 31, 2016 It would be great to have Slack support for notifications. Either using the tokenized App Web API or the Incoming Webhooks feature of Slack would be great! I'm already using plexPy, couchpotato, and sonarr Slack Notification integration, but it would great to have unRAID join the party. Quote Link to comment
ClunkClunk Posted July 31, 2016 Share Posted July 31, 2016 +1 on this. Slack is slowly becoming a centralized place for not only my work communications, but personal as well. unRAID would be great to have in there. Quote Link to comment
dirrtyjoe Posted September 26, 2016 Share Posted September 26, 2016 I'll add a +1 Quote Link to comment
jedimstr Posted October 30, 2016 Author Share Posted October 30, 2016 And a bump... anyone have any word on this request? This is the one notifying thing I use that hasn't added Slack Notifications yet. If not an official method, what's the best way to hack the existing notifications system to feed to Slack via one of the other notification agent options? Quote Link to comment
bonienl Posted October 30, 2016 Share Posted October 30, 2016 If you want to be adventurous and support your own notification agent, look at the file /usr/local/emhttp/webGui/include/NotificationAgents.xml This file is used as an API between unRAID and agents. Any new entries can be simply added here and agents become instantly available to unRAID. Quote Link to comment
jedimstr Posted November 1, 2016 Author Share Posted November 1, 2016 If you want to be adventurous and support your own notification agent, look at the file /usr/local/emhttp/webGui/include/NotificationAgents.xml This file is used as an API between unRAID and agents. Any new entries can be simply added here and agents become instantly available to unRAID. Challenge Accepted: <Agent> <Name>Slack</Name> <Variables> <Variable Help="Get your WebHook as explained [a href='https://api.slack.com/incoming-webhooks' target='_blank'][u]here[/u].[/a]" Desc="WebHook URL" Default="FILL WITH YOUR OWN">WEBH_URL</Variable> <Variable Help="Application name, e.g., unRAID Server." Desc="Application Name" Default="unRAID Server">APP_NAME</Variable> <Variable Help="Specify the fields which are included in the title of the notification." Desc="Notification Title" Default="$SUBJECT">TITLE</Variable> <Variable Help="Specify the fields which are included in the message body of the notification." Desc="Notification Message" Default="$DESCRIPTION">MESSAGE</Variable> </Variables> <Script> <![CDATA[ #!/bin/bash ############ {0} ############ TITLE=$(echo -e "$TITLE") MESSAGE=$(echo -e "$MESSAGE") curl -X POST -d "payload={\"username\": \"$APP_NAME\", \"text\": \"*$TITLE* \n $MESSAGE\"}" $WEBH_URL 2>&1 ]]> </Script> </Agent> This seems to work for Test, but has two issues: [*]No Icon and I don't see where to specify in the XML. [*]Won't save the variables for the WebHook URL and channel My assumption is that some handling code that ingests/transforms this XML defines the available variables and the icon. For the variables, next step is to reuse some of the unused ones like maybe APP_TOKEN and USER_KEY, but I'd rather use something that makes sense. But at least the Proof of Concept works. Ideal of course would be if LimeTech took this and ran with it. ADDENDUM: Nope, changing the new variables to reuse older unused variable names from other notifications doesn't let it save the settings. All works fine in test. I guess for now I'll have to either hardcode it or set the default values to my values (setting default to personal settings works). Quote Link to comment
bonienl Posted November 1, 2016 Share Posted November 1, 2016 1. The icon image needs to be stored in folder /usr/local/emhttp/webGui/icons. The name of the icon is the name of the agent in lowercase and spaces removed. In your case "slack.png". The icon size is preferably 48x48. 2. It is not possible to store or reuse your own variables. Quote Link to comment
jedimstr Posted November 2, 2016 Author Share Posted November 2, 2016 1. The icon image needs to be stored in folder /usr/local/emhttp/webGui/icons. The name of the icon is the name of the agent in lowercase and spaces removed. In your case "slack.png". The icon size is preferably 48x48. 2. It is not possible to store or reuse your own variables. 1. Thanks that worked nicely: 2. Some variables work if you hardcode in your values as "default". Just can't save different values. Also I took out the channel field since you can set that up on the Slack WebHook Custom Integration side. With default hardcoded values for the webhook URL, it's working nicely: Quote Link to comment
gubbgnutten Posted November 3, 2016 Share Posted November 3, 2016 Will absolutely try this, thanks! Quote Link to comment
tokra Posted January 22, 2017 Share Posted January 22, 2017 1. The icon image needs to be stored in folder /usr/local/emhttp/webGui/icons. The name of the icon is the name of the agent in lowercase and spaces removed. In your case "slack.png". The icon size is preferably 48x48. 2. It is not possible to store or reuse your own variables. 1. Thanks that worked nicely: 2. Some variables work if you hardcode in your values as "default". Just can't save different values. Also I took out the channel field since you can set that up on the Slack WebHook Custom Integration side. With default hardcoded values for the webhook URL, it's working nicely: 1.) I wonder where unraid keeps info that notification agent was enabled. 2.) Where do i have to copy unraid logo to see it in my slack, similar you have on your pic Quote Link to comment
tokra Posted January 22, 2017 Share Posted January 22, 2017 +1 for this feature. Quote Link to comment
jedimstr Posted February 4, 2017 Author Share Posted February 4, 2017 1.) I wonder where unraid keeps info that notification agent was enabled. 2.) Where do i have to copy unraid logo to see it in my slack, similar you have on your pic 1) ¯\_( )_/¯ 2) Drop a PNG logo here: /usr/local/emhttp/webGui/icons Quote Link to comment
bonienl Posted February 4, 2017 Share Posted February 4, 2017 1.) I wonder where unraid keeps info that notification agent was enabled. This is stored on your flash device under folder /config/plugins/dynamix/notifications/agents Quote Link to comment
jrdnlc Posted March 16, 2017 Share Posted March 16, 2017 @jedimstr Do you mind sharing the icons you used? Quote Link to comment
jedimstr Posted March 20, 2017 Author Share Posted March 20, 2017 PM'd them On 3/15/2017 at 10:52 PM, jrdnlc said: @jedimstr Do you mind sharing the icons you used? 1 Quote Link to comment
kizer Posted March 22, 2017 Share Posted March 22, 2017 You should contact @Squid and make a plugin for this for the Community Applications 1 Quote Link to comment
vmunich Posted March 23, 2017 Share Posted March 23, 2017 On 3/22/2017 at 11:45 AM, kizer said: You should contact @Squid and make a plugin for this for the Community Applications +1 Quote Link to comment
jedimstr Posted March 31, 2017 Author Share Posted March 31, 2017 Wouldn't something like this be better off as an included Notification than a plugin in CA? Quote Link to comment
jrdnlc Posted April 29, 2017 Share Posted April 29, 2017 Is it normal for the Slack agent to disappear after a reboot on the server? It's not longer under my notifications settings tab Quote Link to comment
Squid Posted April 29, 2017 Share Posted April 29, 2017 1 hour ago, jrdnlc said: Is it normal for the Slack agent to disappear after a reboot on the server? It's not longer under my notifications settings tab If you're modifying the file according to this: Then yes, as unRaid is unpacked fresh from every reboot, and any changes to system files are lost. You need to set up a script or something to inject those changes you're making at every boot (probably via the user scripts plugin) Quote Link to comment
jrdnlc Posted April 29, 2017 Share Posted April 29, 2017 3 minutes ago, Squid said: If you're modifying the file according to this: Then yes, as unRaid is unpacked fresh from every reboot, and any changes to system files are lost. You need to set up a script or something to inject those changes you're making at every boot (probably via the user scripts plugin) dammit. I'll wait and see if someone can help with a user script plugin then lol Quote Link to comment
Squid Posted April 29, 2017 Share Posted April 29, 2017 (edited) 13 minutes ago, jrdnlc said: dammit. I'll wait and see if someone can help with a user script plugin then lol Make the changes again. Then from the command prompt: cp /usr/local/emhttp/webGui/include/NotificationAgents.xml /boot/NotificationAgents.xml Then add a user script (set to run at array start) composed of cp /boot/NotificationAgents.xml /usr/local/emhttp/webGui/include/NotificationAgents.xml But, bear in mind that should LT incorporate Slack notifications in a future release of unRaid, then you're effectively overwriting their changes with yours. (Generally, its not recommended to overwrite system files unless you are aware of the consequences) Edited April 29, 2017 by Squid 1 Quote Link to comment
jrdnlc Posted April 29, 2017 Share Posted April 29, 2017 16 minutes ago, Squid said: Make the changes again. Then from the command prompt: cp /usr/local/emhttp/webGui/include/NotificationAgents.xml /boot/NotificationAgents.xml Then add a user script (set to run at array start) composed of cp /boot/NotificationAgents.xml /usr/local/emhttp/webGui/include/NotificationAgents.xml But, bear in mind that should LT incorporate Slack notifications in a future release of unRaid, then you're effectively overwriting their changes with yours. (Generally, its not recommended to overwrite system files unless you are aware of the consequences) I think I will wait then if it's going to get incorporated soon. I'm in no rush to add it but it's always good to know how it's done. Thanks again! Quote Link to comment
thomast_88 Posted May 13, 2017 Share Posted May 13, 2017 Thanks for the inspiration. This works great Hoping for an official integration in the future. I really started like Slack for both chatting and notifications. 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.