agent | ||
core | ||
monitor | ||
static | ||
templates | ||
.gitignore | ||
Dockerfile | ||
entrypoint.sh | ||
LICENSE | ||
manage.py | ||
monitor-agent.py | ||
README.md | ||
requirements-agent.in | ||
requirements-agent.txt | ||
requirements.in | ||
requirements.txt |
monitor
Basic server resource monitoring & uptime monitor
Monitor is still in development, and there is no stable release yet. Expect backwards-incompatible changes until the 1.0.0 release
Features
- Server resource monitoring
- Service status monitoring (HTTP,TCP,Ping)
Installing Monitor
(!) Monitor only supports MySQL/MariaDB and SQLite for now
Docker
First, create an env file witht the following in it:
SECRET_KEY=!!CHANGE_ME!!
ALLOWED_HOSTS=monitor.example.com
DB_ENGINE=mysql
DB_SERVER=127.0.0.1
DB_PORT=3306
DB_USER=monitor
DB_PASSWORD=monitor
DB_NAME=monitor
Then build start the container:
docker build -t monitor:latest .
docker run --env-file /path/to/monitor.env -p 8000:8000 --name monitor monitor:latest
Visit port 8000, and log in with the default user/password: admin
, admin123
Options
Options are passed as environment variables. Variables marked with a (*) are required!
Variable | Default | Description |
---|---|---|
DEBUG |
False |
Set to True to enable debug. |
SECRET_KEY (*) |
Set this to a secure random string, keep this a secret | |
ALLOWED_HOSTS (*) |
Set this to a comma seperated list of hosts (no spaces). If DEBUG=True you can skip this option | |
TIME_ZONE |
Europe/Brussels |
Set this to the timezone you want to use |
DB_ENGINE |
mysql |
Valid values: mysql ,sqlite . |
DB_SERVER (*) |
127.0.0.1 |
Database server to use |
DB_PORT (*) |
3306 |
Database port |
DB_NAME (*) |
monitor |
Name of the database to use |
DB_USER (*) |
monitor |
Name of the database user |
DB_PASSWORD (*) |
monitor |
Password of the database user |
Running the agent
to run the agent, clone the repository, run pip install -r requirements-agent.txt
and run monitor-agent.py in the background. replace --interval with --no-daemon if you want to run it as a cronjob instead.
Notes on mysql/mariadb:
when the history page does not work, it could be because you did not configure timezones, run the following
sudo apt install tzdata -y
mysql_tzinfo_to_sql /usr/share/zoneinfo | sudo mysql mysql