Alerts dashboard with real-time notifications.
Post json data with proper information. An alert popup will be displayed on the dashboard if its type was error. You can acknowledge it by clicking on the popup and set manual resolved by clicking on it again. If the type is recovery and the message is the same as the error one then its status will be set to resolved and will be gone in a few seconds.
- type: error|recovery
- message: alert details
- severity: 0..5 (none|information|warning|average|high|disaster)
- group: alert group
Curl:
curl -H 'Content-Type: application/json' \ -d {"type":"error", "message":"Low disk space in / on mail01", "severity":"4", "group":"sysop"} \ http://activityserver/send
Python:
import json import requests url = 'http://activityserver/send' payload = {'type': 'error', 'message': 'Low disk space in / on mail01', 'severity': '2', 'group': 'sysop'} r = requests.post(url, data=json.dumps(payload))
- create a virtualenv: virtualenv /path/to/virtualenv
- source /path/to/virtualenv/bin/activate
- git clone this repo to /path/to/alerts-activity-stream
- pip install -r /path/to/alerts-activity-stream/requirements.txt
- create /path/to/alerts-activity-stream/config.py with required settings
- install uwsgi
- install apache or nginx
APP_ID='pusher app id' KEY='pusher app key' SECRET='pusher app secret' DB_PATH='/path/to/sqlite.db'
[uwsgi] vhost = true plugins = python master = true enable-threads = true processes = 2 wsgi-file = /path/to/alerts-activity-stream/alert-activity-stream.py virtualenv = /path/to/virtualenv chdir = /path/to/alerts-activity-stream touch-reload = /path/to/alerts-activity-stream/reload socket = 127.0.0.1:3031
<VirtualHost *:80> ServerName alerts.yourdomain DocumentRoot /path/to/alerts-activity-stream <Directory /path/to/alerts-activity-stream> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> <Location /> Options FollowSymLinks Indexes SetHandler uwsgi-handler uWSGISocket 127.0.0.1:3031 </Location> <Location /static> SetHandler none </Location> </VirtualHost>
server { listen 80; autoindex off; server_name alerts.yourdomain; location /static/ { alias /path/to/alerts-activity-stream/static/; expires max; log_not_found off; } location / { uwsgi_pass 127.0.0.1:3031; include uwsgi_params; } }
- Pusher.com for real-time push notification service
- jQuery for javascript library
- PNotify for awesome javascript notifications
- FlipClock.js for nice clock solution
- Bootstrap for framework
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- Freely distributable and licensed under the MIT license.
- Copyright (c) 2014 Gabor Szelcsanyi