vtacquet/monit

By vtacquet

Updated almost 4 years ago

lightweight monitoring container based on the free Monit 5.28.0 on alpine (https://www.mmonit.com)

Image
0

52

Description: Creates a monitoring container based on Monit 5.28.0 (https://www.mmonit.com).

You can personalize the monit config by mounting another file (see below), if you do not mount one, a sample file will be used (/opt/monit/config/monit.conf.sample).

docker-compose example:

monit:
  hostname: monit
  container_name: monit
  image: vtacquet/monit
  volumes:
   - /etc/localtime:/etc/localtime:ro
   - /opt/docker/monit/config/monit.conf:/opt/monit/config/monit.conf:ro
  ports:
   - "80:80"

monit.conf example:

(changesomeone@server.comand add a real smtp server in stead ofsmtp.server.com)

set daemon 60

set httpd
  port 80
  use address 0.0.0.0
  allow 127.0.0.1/32
  allow 0.0.0.0/0.0.0.0
  allow admin:monit

set mailserver
  smtp.server.com
  port 25

set alert someone@server.com { connection, link, icmp }

set mail-format {
  from: someone@server.com
  reply-to: someone@server.com
  subject: monit [$SERVICE] $EVENT
  message: $SERVICE: $DESCRIPTION
}

check filesystem root
  with path /
  if space free < 5 GB for 2 cycles then alert

check host monit
  with address 127.0.0.1
  group physical
  if failed ping4 for 2 cycles then alert
  if failed port 80 protocol http with http headers [Authorization: Basic YWRtaW46bW9uaXQ=] for 2 cycles then alert

Docker Pull Command

docker pull vtacquet/monit