Jump to content
gfjardim

3rd Party Notification Services

67 posts in this topic Last Reply

Recommended Posts

Hi guys. With the release of beta15, I proudly announce that the notification system now support the use of third-party notifications, like Pushbullet, Twitter and Pushover.

 

The system is kind of rudimentary right now. Scripts, called agents, are stored on /boot/config/plugins/dynamix/notifications/agents directory, and the triggers are adjustable under the Notifications Settings by selecting the Custom checkboxes.

 

The scripts are called with some environment variables: EVENT, SUBJECT, DESCRIPTION, TIMESTAMP and IMPORTANCE.

 

These are some working agents:

 

Pushbullet:

#!/bin/bash
#############
TOKEN="--put-your-access-token-here--" # Can be found here: https://www.pushbullet.com/account
#############

DATE=$(date --date="@$TIMESTAMP" '+%Y/%m/%d %H:%M:%S')
curl -s -k -X POST --header "Authorization: Bearer $TOKEN" \
   --header  'Content-Type: application/json' \
   -d "{\"type\": \"note\", \"title\": \"$SUBJECT\", \"body\": \"$DESCRIPTION\"}" \
   https://api.pushbullet.com/v2/pushes

 

Pushover:

#!/bin/bash
##########################
USER_KEY="--put-your-user-key-here--" # Can be found here: https://pushover.net/
APP_TOKEN="--put-your-app-token-here--" # Can be created here: https://pushover.net/apps
MESSAGE="<b>$SUBJECT "$'\n'" $DESCRIPTION"
#########################"
case "$IMPORTANCE" in
  'normal' )
    PRIORITY="-1"
    ;;
  'warning' )
    PRIORITY="0"
    ;;
  'alert' )
    PRIORITY="1"
    ;;
esac

curl -s \
  --form-string "token=$APP_TOKEN" \
  --form-string "user=$USER_KEY" \
  --form-string "message=$MESSAGE" \
  --form-string "timestamp=$TIMESTAMP" \
  --form-string "priority=$PRIORITY" \
  --form-string "html=1" \
  https://api.pushover.net/1/messages.json

 

Hope this can help users getting started.

 

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

Share this post


Link to post

could there be a possibility of having two or more outputs for notifications ?

 

so for instance i can send less critical stuff to email and really serious things to pushover

Share this post


Link to post

could there be a possibility of having two or more outputs for notifications ?

 

so for instance i can send less critical stuff to email and really serious things to pushover

 

Yes, of course: under Settings/Notifications, set something like this:

 

xSOJBWa.png

 

In this case, Notices will be sent to browser popup and email; alerts and warnings will be sent to browser pupup and custom agent .

 

Test 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"

Share this post


Link to post

PS

 

like the docker update notification.

 

Thanks. Bonienl contributed with thing or two too (like the most of notification system)...

 

Share this post


Link to post

PS

 

like the docker update notification.

 

Thanks. Bonienl contributed with thing or two too (like the most of notification system)...

 

And thanks gfjardim for the "agents" extension, works like a charm (using pushbullet) :)

 

Share this post


Link to post

This looks cool! Any recommendations for a Windows Phone 8 and Windows Tablet push service? I don't have any experience using push notifications. I had a quick look at the app store and found this https://pushalot.com/api which looks like I could use.

 

I'll have more time next week to give this a try.

 

Gary

Share this post


Link to post
The system is kind of rudimentary right now. Scripts, called agents, are stored on /boot/config/plugins/dynamix/notifications/agents directory, and the triggers are adjustable under the Notifications Settings by selecting the Custom checkboxes.

 

 

do we have to create that folder or should it exist now by default ? , i don't have it.

 

and in terms of pushover, will i have to create my own application ?

 

are there plans for LT to have it's own app on pushover, similar to some other software i use , ie couch, sick etc...

 

 

Share this post


Link to post

The system is kind of rudimentary right now. Scripts, called agents, are stored on /boot/config/plugins/dynamix/notifications/agents directory, and the triggers are adjustable under the Notifications Settings by selecting the Custom checkboxes.

 

 

do we have to create that folder or should it exist now by default ? , i don't have it.

 

and in terms of pushover, will i have to create my own application ?

 

are there plans for LT to have it's own app on pushover, similar to some other software i use , ie couch, sick etc...

 

The whole notification agents is very fresh, and at this point in time it requires several manual actions, like creating the folder and writing (copying) the script yourself.

 

Some improvements in the user experience can be made (read: easier usage), give it some time.

 

Share this post


Link to post

The system is kind of rudimentary right now. Scripts, called agents, are stored on /boot/config/plugins/dynamix/notifications/agents directory, and the triggers are adjustable under the Notifications Settings by selecting the Custom checkboxes.

 

 

do we have to create that folder or should it exist now by default ? , i don't have it.

 

and in terms of pushover, will i have to create my own application ?

 

are there plans for LT to have it's own app on pushover, similar to some other software i use , ie couch, sick etc...

 

The whole notification agents is very fresh, and at this point in time it requires several manual actions, like creating the folder and writing (copying) the script yourself.

 

Some improvements in the user experience can be made (read: easier usage), give it some time.

 

0NFYNgk.png

Share this post


Link to post

The system is kind of rudimentary right now. Scripts, called agents, are stored on /boot/config/plugins/dynamix/notifications/agents directory, and the triggers are adjustable under the Notifications Settings by selecting the Custom checkboxes.

 

 

do we have to create that folder or should it exist now by default ? , i don't have it.

 

and in terms of pushover, will i have to create my own application ?

 

are there plans for LT to have it's own app on pushover, similar to some other software i use , ie couch, sick etc...

 

The whole notification agents is very fresh, and at this point in time it requires several manual actions, like creating the folder and writing (copying) the script yourself.

 

Some improvements in the user experience can be made (read: easier usage), give it some time.

So we create the folder and we copy/paste the script into a script file named what?

Share this post


Link to post

The system is kind of rudimentary right now. Scripts, called agents, are stored on /boot/config/plugins/dynamix/notifications/agents directory, and the triggers are adjustable under the Notifications Settings by selecting the Custom checkboxes.

 

 

do we have to create that folder or should it exist now by default ? , i don't have it.

 

and in terms of pushover, will i have to create my own application ?

 

are there plans for LT to have it's own app on pushover, similar to some other software i use , ie couch, sick etc...

 

The whole notification agents is very fresh, and at this point in time it requires several manual actions, like creating the folder and writing (copying) the script yourself.

 

Some improvements in the user experience can be made (read: easier usage), give it some time.

So we create the folder and we copy/paste the script into a script file named what?

 

Any name you like, I have called mine "pushbullet" since that is what I am using as app.

 

Share this post


Link to post

The system is kind of rudimentary right now. Scripts, called agents, are stored on /boot/config/plugins/dynamix/notifications/agents directory, and the triggers are adjustable under the Notifications Settings by selecting the Custom checkboxes.

 

 

do we have to create that folder or should it exist now by default ? , i don't have it.

 

and in terms of pushover, will i have to create my own application ?

 

are there plans for LT to have it's own app on pushover, similar to some other software i use , ie couch, sick etc...

 

The whole notification agents is very fresh, and at this point in time it requires several manual actions, like creating the folder and writing (copying) the script yourself.

 

Some improvements in the user experience can be made (read: easier usage), give it some time.

So we create the folder and we copy/paste the script into a script file named what?

 

Any name you like, I have called mine "pushbullet" since that is what I am using as app.

OK, then I guess what you mean is that the checkbox that says Custom will run any and all scripts in that folder?

Share this post


Link to post

The system is kind of rudimentary right now. Scripts, called agents, are stored on /boot/config/plugins/dynamix/notifications/agents directory, and the triggers are adjustable under the Notifications Settings by selecting the Custom checkboxes.

 

 

do we have to create that folder or should it exist now by default ? , i don't have it.

 

and in terms of pushover, will i have to create my own application ?

 

are there plans for LT to have it's own app on pushover, similar to some other software i use , ie couch, sick etc...

 

The whole notification agents is very fresh, and at this point in time it requires several manual actions, like creating the folder and writing (copying) the script yourself.

 

Some improvements in the user experience can be made (read: easier usage), give it some time.

So we create the folder and we copy/paste the script into a script file named what?

 

Any name you like, I have called mine "pushbullet" since that is what I am using as app.

OK, then I guess what you mean is that the checkbox that says Custom will run any and all scripts in that folder?

 

Correct, all scripts present under the folder 'agents' will be run when 'Custom' is checked. So you may setup different apps to receive the notifications.

 

Share this post


Link to post

Nah, I would grab a beer and watch the event from my chair, should be a great show  :D

Share this post


Link to post

Nah, I would grab a beer and watch the event from my chair, should be a great show  :D

 

0741.png

Share this post


Link to post

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.