Skip to content

jchonig/docker-monit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-monit

A container running monit for the purpose of monitoring other containers.

Usage

docker

docker create \
  --name=monit \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -e MMONIT_URL="https://USERID:PASSWORD@mmonit.your.domain:2812/collector"
  --expose 2812 \
  -v </path/to/appdata/config>:/config \
  --restart unless-stopped \
  jchonig/monit

docker-compose

Compatible with docker-compose v2 schemas.

---
version: "2"
services:
  monit:
    image: jchonig/monit
    container_name: monit
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - MMONIT_URL="https://USERID:PASSWORD@mmonit.your.domain:2812/collector"
    volumes:
      - </path/to/appdata/config>:/config
    expose:
      - 2812
    restart: unless-stopped

Parameters

Ports (--expose)

Volume Function
2812 Used by M/Monit to communicate with this instance of Monit

XXX - Security

Environment Variables (-e)

Env Function
PUID=1000 for UserID - see below for explanation
PGID=1000 for GroupID - see below for explanation
TZ=UTC Specify a timezone to use EG UTC
MMONIT_URL URL used to communicate with M/Monit

Volume Mappings (-v)

Volume Function
/config All the config files reside here

Application Setup

  • Environment variables can also be passed in a file named env in the config directory. This file is sourced by the shell.
  • Monit configuration is assembled from config files found in config/monit.d.
  • If it does not exist, config/monit.d/http is used created to specify the port Monit listens on.
  • If MMONIT_URL is passed in the environment, config/monit.d/mmonit is created using this variable as the parameter to a set mmonit directive.

Local port

If the file config/monit.d/http is not present on startup, this file will be created with the following content

set httpd port 2812
    allow localhost
    allow ${NETWORK}/${NETMASK}

Where NETWORK and NETMASK are those of the container.

M/Monit connection

If the environment variable MMONIT_URL is defined, the file config/monit.d/mmonit is created with the following content:

set monit ${MMONIT_URL}

TODO

  • Document configuration
  • Document alpine monit version issues

About

A container to run monit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published