You are not logged in.

#1 2016-11-28 04:42:07

gaenserich
Member
From: Michigan
Registered: 2010-06-07
Posts: 119
Website

What do you use for push notifications from server?

Right now I use a combination of email (w/PGP) and ssh for getting quick, libnotify-like notifications from my server (see below). Neither is particularly good at the job. Email tends to be reliable but slow, while my ssh set up is quick but not particularly reliable. I do like how both are relatively easy to set up and are lighter on resources.

I'd love to use something like an open source, self-hosted pushbullet if I could have reliable end-to-end encryption. I dabbled a bit with xmpp+otr, but my implementation left something to be desired in both elegance (I created a sort of client daemon by launching mcabber in tmux and using using a fifo to send messages) and reliability (messages sent when the pushed-to device was offline didn't propagate after pushed-to device logged on).

My question: What do you use to get fast push messages from your linux server to your linux box and/or android?

About my existing methods:

Email + PGP: I made a script that basically inserts gpg in a pipe right before being sent by a msmtp. Great for system mantainence notifications and log dumps, but bad for IOT events like motion detection notices.

SSH: On my server, I made a script called "notify-send" that inserts quasi-libnotify-esque notifications into the systemd journal:

#!/bin/bash
while getopts "u:t:a:i:c:h:?" option; do
    case "$option" in
        \?)
            cat << EOF
Usage:
  $0 [OPTION...] <SUMMARY> [BODY] - create a notification

Help Options:
  -?                            Show help options

Application Options:
  -u LEVEL                      Specifies the urgency level (low, normal, critical).
  -t TIME                       Specifies the timeout in milliseconds at which to expire the notification.
  -a APP_NAME                   Specifies the app name for the icon
  -i ICON[,ICON...]             Specifies an icon filename or stock icon to display.
  -c TYPE[,TYPE...]             Specifies the notification category.
  -h TYPE:NAME:VALUE            Specifies basic extra data to pass. Valid types are int, double, string and byte.

EOF
            exit 1
        ;;
        u)
            [ "$OPTARG" != "" ] && opt="-u $OPTARG"
            [ "$OPTARG" == "critical" ] && _send_mail=1
        ;;
        t) [ "$OPTARG" != "" ] && opt="$opt -t $OPTARG";;
        a) [ "$OPTARG" != "" ] && opt="$opt -a $OPTARG";;
        i) [ "$OPTARG" != "" ] && opt="$opt -i $OPTARG";;
        c) [ "$OPTARG" != "" ] && opt="$opt -c $OPTARG";;
        h) [ "$OPTARG" != "" ] && opt="$opt -h $OPTARG";;
    esac
done
shift $((OPTIND-1))
pass_to_journal=$(echo -e "<options>$opt</options> <summary>$1</summary> <body>$2</body>" | sed ':a;N;$!ba;s/\n/<newline>/g')
systemd-cat -t notify-send echo "$pass_to_journal"

When online, I scripted my laptop to connect to my server via ssh and pipe out journalctl into a bash script, like this:

ssh user@server journalctl -f -n1 -o cat --since -1s SYSLOG_IDENTIFIER=notify-send | while read line; do
            options=$(echo "$line" | sed "s/.*<options>\(.*\)<\/options>.*/\1/g")
            summary=$(echo "$line" | sed "s/.*<summary>\(.*\)<\/summary>.*/\1/g")
            body=$(echo "$line" | sed -e "s/.*<body>\(.*\)<\/body>.*/\1/g" -e "s/<newline>/\n/g")
            DISPLAY=:0 notify-send $options "$summary" "$body"
        done

This is ineligant, can't be used with android, and depends a lot on a persistent ssh connection, which makes it unreliable on spotty connections.


Check out hostsblock for system-wide ad- and malware-blocking.

Offline

#2 2017-02-07 05:32:34

Meskarune
Member
From: Helsinki, Finland
Registered: 2009-03-21
Posts: 361
Website

Re: What do you use for push notifications from server?

Sorry for necro-bumping...but I want to remember this for later and also have the same question. I know logs and things can all get sent to a server, but is there something similar to pushover that uses libnotify?


Homepage  | Arch Linux Women | Arch Linux Classroom
Acer Aspire E5-575G-53VG:
Intel Dual-Core i5-6200U 2.3 GHz; Skylake rev3 | 8GB DDR4 ram | Intel HD Graphics 520 + NVIDIA GeForce 940MX
Qualcomm Atheros QCA9377 802.11ac | Realtek RTL8111/8168/8411 Gigabit Ethernet Controller

Offline

#3 2017-02-07 06:31:58

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: What do you use for push notifications from server?

Came across this a while ago, but haven't had time to figure it out - https://www.reddit.com/r/PushBullet/com … ve_pushjet


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2017-02-08 12:05:39

xvzf
Member
Registered: 2014-05-18
Posts: 86

Re: What do you use for push notifications from server?

I am using a similar approach.
My ZFS Daemon sends me a mail (PGP encrypted), if an operation was successful or there was an error. The same goes for my UPS.
If Temperature or Voltages are out of acceptable Range, the IPMI will send me a mail (not encrypted).
Beside that, I log in via ssh about every week.

Cheers

Offline

#5 2017-02-11 23:42:40

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 652

Re: What do you use for push notifications from server?

OP, after reading this thread a few days ago I thought it was a good idea to have a small script which can send notifications to my phone. I have a few uses for this from various servers etc. After a bit of trial and error I have settled on pushover which has been working well so far.

Offline

Board footer

Powered by FluxBB