2018-02-28 19:32:53 +01:00
# Monit - UNIX Systems Management
2024-08-20 05:11:55 +02:00
Run Monit inside docker. From project [docker-monit ](https://github.com/kijart/docker-monit )
2018-02-28 19:32:53 +01:00
[![Monit ](https://mmonit.com/monit/img/logo.png )](https://mmonit.com/monit/)
[Monit ](https://mmonit.com/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.
2020-09-12 14:07:59 +02:00
Default username/password: `admin/monit`
2019-11-15 20:10:24 +01:00
2020-09-12 14:09:57 +02:00
## Versions
| Docker image | Monit |
| ---------------------- | --------- |
2024-08-20 05:11:55 +02:00
| `monit:latest` | `5.34.0` |
2020-09-12 14:09:57 +02:00
2018-02-28 19:32:53 +01:00
## Docker setup
2020-09-12 14:07:59 +02:00
Install docker: < https: / / docs . docker . com / engine / installation / >
2018-02-28 19:32:53 +01:00
2020-09-12 14:07:59 +02:00
Install docker compose: < https: / / docs . docker . com / compose / install / >
2018-03-03 13:09:49 +01:00
2020-09-12 14:07:59 +02:00
Docker documentation: < https: / / docs . docker . com / >
2018-02-28 19:32:53 +01:00
### Build-in docker image
- build docker image `docker build -t monit .`
2020-09-12 14:07:59 +02:00
- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc monit`
2022-01-25 02:55:55 +08:00
> note: monitrc is a file! create before docker run.
2018-02-28 20:10:16 +01:00
2024-08-20 05:11:55 +02:00
### Build-in docker image arm64
- build docker image `docker buildx build --platform arm64 -t monit .`
- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc monit`
> note: monitrc is a file! create before docker run.
2018-02-28 20:10:16 +01:00
### Docker Hub image
2024-12-15 02:53:53 +01:00
- pull docker image from gitlab: `docker pull registry.manalejandro.com/monit:latest`
2018-02-28 20:10:16 +01:00
2024-12-15 02:53:53 +01:00
- start monit: `docker run --rm -it -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc registry.manalejandro.com/monit:latest`
2018-02-28 20:10:16 +01:00
- create a docker container:
2019-11-15 20:10:24 +01:00
```bash
2018-02-28 20:10:16 +01:00
docker create \
--name=monit \
-p 2812:2812 \
-v $(pwd)/monitrc:/etc/monitrc \
2024-12-15 02:53:53 +01:00
registry.manalejandro.com/monit:latest
2018-02-28 20:10:16 +01:00
```
2018-03-03 13:09:49 +01:00
### Docker compose
- create a container using docker-compose: `docker-compose up --no-start`
- start monit: `docker-compose up`
2018-02-28 20:10:16 +01:00
### 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` .
2022-01-25 02:55:55 +08:00
If when starting Monit returns the following message: `input in flex scanner failed` , simply you need to create an empty file with name `monitrc` in your source folder will do.