3rd Party Notification Services


gfjardim

Recommended Posts

  • Replies 66
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

If anyone wants to get notification to kodi(xbmc), make a script in the agents folder containing below. Obviously you have to put your kodi ip, path to image...

#!/bin/bash
#############

wget  --spider --header="Content-Type: application/json" --post-data="{\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"$SUBJECT\",\"message\":\"$DESCRIPTION\", \"image\":\"smb://path_to_image/logo.png\"},\"displaytime\":5000,\"id\":1}" http://xbmc:password@kodi_ip:9090/jsonrpc

 

You must set "allow control of kodi via http" to true in kodi.

Link to comment

PS: Which are your favorite push services? I will compile a list to begin writing a configuration page for it.

 

Could we get support for Prowl? It's great for iOS devices (and free  ;D).

The app isn't.

I can't test it, so please let me know if this works:

 

#!/bin/bash
############
APP_NAME="unRAID"
API_KEY="" #found here: https://www.prowlapp.com/api_settings.php
TITLE=$SUBJECT
MESSAGE=$DESCRIPTION
############
MESSAGE=$(echo -e "$MESSAGE")

case "$IMPORTANCE" in
'normal' )
PRIORITY="0"
;;
'warning' )
PRIORITY="1"
;;
'alert' )
PRIORITY="2"
;;
esac

curl \
-F "apikey=${API_KEY}" \
-F "application=${APP_NAME}" \
-F "event=${TITLE}" \
-F "description=${MESSAGE}" \
-F "priority=$PRIORITY" \
https://api.prowlapp.com/publicapi/add 

 

Some text commands:

 

notify -e "Notice Test" -s "Notice Test" -d "This is a test for Notices" -i "normal"
notify -e "Warning Test" -s "Warning Test" -d "This is a test for Warnings" -i "warning"
notify -e "Alert Test" -s "Alert Test" -d "This is a test for Alerts" -i "alert"

Link to comment

The app isn't.

Hmm I must have downloaded it when it was on sale or something then. Thank you so much for working on this BTW!

 

Results:

 

notify -e "Warning Test" -s "Notice Test" -d "This is a test for Notices" -i "normal"

curl: try 'curl --help' or 'curl --manual' for more information

/boot/config/plugins/dynamix/notifications/agents/prowl: line 20: -F: command not found

 

 

Link to comment

Results:

 

notify -e "Warning Test" -s "Notice Test" -d "This is a test for Notices" -i "normal"

curl: try 'curl --help' or 'curl --manual' for more information

/boot/config/plugins/dynamix/notifications/agents/prowl: line 20: -F: command not found

 

Ok, my bad. Get the fixed code and try again.

Link to comment
  • 2 weeks later...

Is there a script or anything that can be called to trigger custom notifications?

 

For example, you might have a script that copies a bunch of files from one drive to another (maybe you're migrating from reiser to xfs), it would be good to be able to add a step to the end of that script that triggers a notification to say it has completed.

 

Link to comment

Any of these should do the trick ...

 

notify -e "Notice Test" -s "Notice Test" -d "This is a test for Notices" -i "normal"
notify -e "Warning Test" -s "Warning Test" -d "This is a test for Warnings" -i "warning"
notify -e "Alert Test" -s "Alert Test" -d "This is a test for Alerts" -i "alert"

 

or you could just call the notification script directly if you want to bypass the unRAID notification on screen.

 

Link to comment

Any of these should do the trick ...

 

notify -e "Notice Test" -s "Notice Test" -d "This is a test for Notices" -i "normal"
notify -e "Warning Test" -s "Warning Test" -d "This is a test for Warnings" -i "warning"
notify -e "Alert Test" -s "Alert Test" -d "This is a test for Alerts" -i "alert"

 

or you could just call the notification script directly if you want to bypass the unRAID notification on screen.

 

Thanks for that, I didn't realise that functionality already existed.

 

Works a treat :D

 

Should now hopefully get some PushBullet notifications when a couple of long file copies have finished.

Link to comment

Any of these should do the trick ...

 

notify -e "Notice Test" -s "Notice Test" -d "This is a test for Notices" -i "normal"
notify -e "Warning Test" -s "Warning Test" -d "This is a test for Warnings" -i "warning"
notify -e "Alert Test" -s "Alert Test" -d "This is a test for Alerts" -i "alert"

 

or you could just call the notification script directly if you want to bypass the unRAID notification on screen.

 

Thanks for that, I didn't realise that functionality already existed.

 

Works a treat :D

 

Should now hopefully get some PushBullet notifications when a couple of long file copies have finished.

 

It is easy to use the notifications system in your own script, this is achieved by either calling the script notify within a shell script or by calling the module Notify.php within a PHP program.

Both approaches use the same optional parameters to form the notification.

 

-e = event description

-s = subject description

-d = detailed description

-i = importance (normal, warning, alert)

-m = message content

-x = single notification (i.e. the same notification will not be repeated)

 

 

 

Link to comment

This will make someone giggle, i have this thread on notify.

 

i just saw five emails with notification and unraid in the title and thought oh fu*k something major has happened to my server.

 

You can exclude email notifications, if that makes you happier  ;)

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.