2015-07-02 12:59:58 +02:00
|
|
|
monit
|
|
|
|
=====
|
|
|
|
|
2015-07-27 16:17:09 +02:00
|
|
|
![](https://badge.imagelayers.io/vimagick/monit:latest.svg)
|
2015-07-02 14:00:29 +02:00
|
|
|
|
2015-07-02 12:59:58 +02:00
|
|
|
`Monit` is a utility for managing and monitoring processes, programs, files,
|
|
|
|
directories and filesystems on a Unix system.
|
|
|
|
|
2015-07-02 14:00:29 +02:00
|
|
|
## directory tree
|
|
|
|
|
|
|
|
```
|
|
|
|
~/fig/monit/
|
|
|
|
├── docker-compose.yml
|
|
|
|
└── monit/
|
|
|
|
├── conf.d/
|
|
|
|
│ ├── network.cfg
|
|
|
|
│ ├── setting.cfg
|
|
|
|
│ └── system.cfg
|
|
|
|
└── monitrc
|
|
|
|
```
|
|
|
|
|
2015-07-05 05:04:02 +02:00
|
|
|
> Make sure config file endswith `.cfg`.
|
|
|
|
|
2015-07-02 12:59:58 +02:00
|
|
|
## docker-compose.yml
|
|
|
|
|
|
|
|
```
|
|
|
|
monit:
|
|
|
|
image: vimagick/monit
|
|
|
|
volumes:
|
|
|
|
- monit:/etc/monit
|
|
|
|
pid: host
|
|
|
|
net: host
|
|
|
|
restart: always
|
|
|
|
```
|
|
|
|
|
2015-07-02 13:27:37 +02:00
|
|
|
> The control file `/etc/monit/monitrc` must have permissions no more than
|
|
|
|
> `-rwx------ (0700)`
|
|
|
|
|
2015-07-02 12:59:58 +02:00
|
|
|
## server
|
|
|
|
|
|
|
|
```
|
|
|
|
$ cd ~/fig/monit/
|
|
|
|
$ docker-compose up -d
|
2015-07-02 15:39:10 +02:00
|
|
|
$ docker exec monit_monit_1 monit status
|
2015-07-02 12:59:58 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## client
|
|
|
|
|
|
|
|
```
|
2015-07-02 14:53:28 +02:00
|
|
|
$ firefox http://admin:monit@server:2812
|
2015-07-02 12:59:58 +02:00
|
|
|
```
|