SimpleMonitor by James Seward is a Python script which monitors hosts and network connectivity. It is designed to be quick and easy to set up and lacks complex features that can make things like Nagios, OpenNMS and Zenoss overkill for a small business or home network. Remote monitor instances can send their results back to a central location.
Give jamesoff/simplemonitor a Star!
This docker image installs SimpleMonitor on Alpine and includes a nginx webserver, where you can get the status of your hosts and services.
I don't like docker run
commands with a lot of arguments, so here's a sample docker-compose
file:
version: '3.2'
services:
simplemonitor:
restart: always
image: braindoctor/simplemonitor-docker:latest
container_name: simplemonitor
hostname: simplemonitor.domain.local
volumes:
- /tmp/simplemonitor:/etc/simplemonitor
ports:
- "8080:8080"
The default docker-compose.yml file has more detailed comments.
You should now be able to point your browser to http://simplemonitor:8080
and retrieve a basic status HTML page:
http://simplemonitor:8080/status.json
returns a JSON representation of the service status, if you want to poll it by a browser and create nice badges with javascript (or whatever). Do not expect the "API" to be stable though (some fields may change in future, watch the changelogs).
{
"generated":"2017-07-31 15:03:35",
"monitors":{
"localhost":{
"status":"OK",
"virtual_fail_count":0,
"last_run_duration":0.0034890174865722656,
"dependencies":[],
"result":"0.037ms",
"first_failure_time":""
}
}
}
- First make sure that the volume paths to your docker-compose.yml are correct to make them persistent
- Bring up the container by running
docker-compose up -d
. The default configuration is being copied to the location above. - Stop the container by running
docker-compose stop
. - Modify
/path/to/your/simplemonitor/global.ini
as appropriate. See http://jamesoff.github.io/simplemonitor/configuration.html for reference. - Configure your services
/path/to/your/simplemonitor/monitors.ini
. See http://jamesoff.github.io/simplemonitor/monitors.html for reference. - Start the container again by running
docker-compose start
You have 2 options:
- Edit
/etc/nginx/nginx.conf
and/etc/nginx/conf.d/simplemonitor.conf
as needed. Make sure to make the changes persistent by mounting them from outside. - Or you could setup a reverse-proxy in front of this image. Check out the excellent jwilder/nginx-proxy!
This image and software has been designed with simplicity in mind, not for security or scalability. As always, use it at your own risk!