Run Monit inside docker.
Go to file
Luis Miguel Vicente Fuentes 8701a84fb6 Merge tag '1.2.0' into develop
v1.2.0
2019-11-15 20:11:45 +01:00
docker-compose.yml Add docker compose file 2018-03-03 13:09:49 +01:00
Dockerfile Update monit version from v5.25.2 to v5.26.0 2019-11-15 20:10:24 +01:00
monitrc Add Monit control file 2018-02-28 19:26:12 +01:00
README.md Update monit version from v5.25.2 to v5.26.0 2019-11-15 20:10:24 +01:00

Monit - UNIX Systems Management

Run Monit inside docker.

Monit

Monit is a free open source utility for managing and monitoring, processes, programs, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.

Default username/password: admin/monit

Docker setup

Install docker: https://docs.docker.com/engine/installation/

Install docker compose: https://docs.docker.com/compose/install/

Docker documentation: https://docs.docker.com/

Build-in docker image

  • build docker image docker build -t monit .

  • start monit: docker run -ti -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc monit

Docker Hub image

  • pull docker image from docker hub: docker pull kijart/monit

  • start monit: docker run -ti -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc kijart/monit

  • create a docker container:

docker create \
  --name=monit \
  -p 2812:2812 \
  -v $(pwd)/monitrc:/etc/monitrc \
  kijart/monit

Docker compose

  • create a container using docker-compose: docker-compose up --no-start

  • start monit: docker-compose up

Troubleshooting

If when starting Monit returns the following message: The control file '/etc/monitrc' permission 0755 is wrong, maximum 0700 allowed, simply give the appropriate permissions to monitrc: chmod 700 monitrc.