dougbeal / simplemonitor-docker

Docker files to build simplemonitor instances

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About SimpleMonitor

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!

About this Docker image

This docker image installs SimpleMonitor on Alpine and includes a nginx webserver, where you can get the status of your hosts and services.

Run it

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: status html

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":""
        }
    }
}

Configure it

  1. First make sure that the volume paths to your docker-compose.yml are correct to make them persistent
  2. Bring up the container by running docker-compose up -d. The default configuration is being copied to the location above.
  3. Stop the container by running docker-compose stop.
  4. Modify /path/to/your/simplemonitor/global.ini as appropriate. See http://jamesoff.github.io/simplemonitor/configuration.html for reference.
  5. Configure your services /path/to/your/simplemonitor/monitors.ini. See http://jamesoff.github.io/simplemonitor/monitors.html for reference.
  6. Start the container again by running docker-compose start

SSL Support

You have 2 options:

  1. 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.
  2. Or you could setup a reverse-proxy in front of this image. Check out the excellent jwilder/nginx-proxy!

Other

This image and software has been designed with simplicity in mind, not for security or scalability. As always, use it at your own risk!

About

Docker files to build simplemonitor instances

License:MIT License


Languages

Language:Dockerfile 54.7%Language:Shell 45.3%