A system monitor that exposes a REST API.
Declare MONITOR_ACCESS_TOKEN
as environment variable before running the application. The
clients should add the header Auth-Token:
with the same token to access.
- Python 2.7
- Bottle
- Psutils
- Virtualenv (Optional)
For now, just copy the code into your server and add a virtual environment for it:
$ pip install virtualenv
$ virtualenv folder
$ source folder/bin/activate
$ pip install bottle psutil
This minimal bottle application runs in the port 3344.
$ python monitor.py
$ wget -qO - --header 'Auth-Token: mytoken' http://my-server:3344/ | python -m json.tool