quentin-st / Munin-for-Android

Watch your munin-monitored servers on your Android devices
https://www.munin-for-android.com/
GNU General Public License v2.0
44 stars 7 forks source link

Push notifications from server to Android device #26

Closed quentin-st closed 9 years ago

quentin-st commented 9 years ago

For now, Munin for Android is polling each server from time to time to see if everything is OK. @edovino Was the first to let me know that this is not the best way to do. Indeed, if a CPU spike happens between two polls, it won't be reported to user.

I'd like to refactor the whole notifications process. This will be done in two steps:

1- Individual notifications

One alert will trigger one notification, instead of one notification for all alerts. This will allow dismissing an alert for 1 hour, 1 day or forever. This will also make the whole feature easier to understand for new users.

2- Push to device

Instead of Munin for Android polling each munin installation, one small program will be called when an alert is triggered on the server. This program will take all the necessary information and send those using Google Cloud Messaging API (or whatever) to the device. Notifications will be shown on user device if it hasn't been ignored.

This will allow way lower data consumption, and real time notifications. The program could be written in Python (cool, easy to learn, read, maintain and debug), and of course open source too. The whole process will be documented in order to be easy to install.

Munin alert -> script

Interfacing munin with a small script is really easy: http://munin.readthedocs.org/en/latest/tutorial/alert.html

Script -> Google Cloud Messaging API

Google Cloud Messaging API -> app -> notification

edovino commented 9 years ago

This might be a good option to use https://zeropush.com/ - saves everyone from having to run their own push server.

quentin-st commented 9 years ago

Thanks for the suggestion! I already began to implement push notifications, we're using Google Cloud Messaging and the two following projects:

It works really well, I just have to enhance it a bit before merging the notifications branch into master.