3rd Party Notification Services


gfjardim

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.

Link to comment
  • Replies 66
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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"

Link to comment
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...

 

 

Link to comment

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.

 

Link to comment

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

Link to comment

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?
Link to comment

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.

 

Link to comment

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?
Link to comment

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.

 

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.