A simple uptime monitor that checks if a host is up or down.
I wanted to monitor hosts in my network in similar way to how UptimeRobot does it.
Start service with WSGI, e.g. gunicorn
:
gunicorn wsgi -b <ip-address>:<port> --chdir /path/to/uptime-monitor --worker-class eventlet
Also, remember to add following command to crontab to run the monitor every minute.
* * * * * /path/to/python -m flask --app /path/to/uptime-monitor/app/app.py iputils ping
To update the monitor:
- pull the latest changes from the repository,
- upgrade database schema:
/path/to/python -m flask --app /path/to/uptime-monitor/app/app.py db upgrade # or flask db upgrade # if you are in the root of the project and using correct venv
- restart the service.
All commands have to be run from the root of the project.
flask manage add <ip-address> [--name <friendly-name>]
flask manage set-name <new-name> --to <ip-address>
flask manage remove <ip-address>