Receiving notifications from a remote machine as a local event

Assume (just because logging is a common practice) your application (on remote server) writes each event in a file. So each new line in that file is a desired notification. The trick:

ssh my.remote.server 'tail -f /path/to/notifications/log' | while read line; do notify-send 'Server says' "$line"; done

So once new line will appear in the log on the server you will see popup on local desktop.


Put an mqtt broker on the remote, or on a third machine if you want. Publish the event from the remote to the broker. On the local, subscribe to the event topic via the broker. The local could be running something that invokes notify-send.

The mosquitto package comes with command-line programs for publish and subscribe so you can try this out in that way. Installing the package installs a broker if I recall correctly.