Update: You want mqttwarn
Sometimes important things happen on your networks and you want to be notified about them. For some, notification means an SMS or a popup somewhere, for others it may mean a Nagios or Icinga alert. Using an MQTT messaging system is a very lightweight method of distributing alerts, picking them up in different locations and by different programs and handling them in a particular manner.
I recently released an MQTT notifier for Prowl, which subscribes to any number of MQTT topics and fires off a Prowl notification to my phone when something of relevance to me is published to one of those topics.
I was asked
whether something similar could be done for the OSX notification bar on a Mac,
and it was easy to implement using terminal-notifier
and a Python module which
handles it. In short order I basically copied the Prowl notifier and created
MQTT-OSX-Notifier.
These programs are both very similar: they subscribe to any number of MQTT topics and notify Prowl or the OSX notification center respectively.
For example, I could use either or both of these programs coupled with Ansible. You may recall that I wrote the mqtt notification module for Ansible which, used judiciously with either or both of these programs, could notify me that a particular Ansible run has completed.
Either program is probably best launched via Supervisor or similar utility, so that it’s always running.
See also: mqtt-growl written in Node.js