diff --git a/monit/Dockerfile b/monit/Dockerfile new file mode 100644 index 0000000..558cdd8 --- /dev/null +++ b/monit/Dockerfile @@ -0,0 +1,16 @@ +# +# Dockerfile for monit +# + +FROM alpine +MAINTAINER kev + +RUN apk add -U monit \ + && rm -rf /var/cache/apk/* + +COPY monit /etc/monit + +VOLUME /etc/monit /var/lib/monit +EXPOSE 2812 + +CMD ["monit", "-I", "-c", "/etc/monit/monitrc"] diff --git a/monit/README.md b/monit/README.md new file mode 100644 index 0000000..5d87624 --- /dev/null +++ b/monit/README.md @@ -0,0 +1,31 @@ +monit +===== + +`Monit` is a utility for managing and monitoring processes, programs, files, +directories and filesystems on a Unix system. + +## docker-compose.yml + +``` +monit: + image: vimagick/monit + volumes: + - monit:/etc/monit + pid: host + net: host + restart: always +``` + +## server + +``` +$ cd ~/fig/monit/ +$ docker-compose up -d +$ docker exec monit_monit_1 monit status +``` + +## client + +``` +$ firefox http://server:2812 +``` diff --git a/monit/docker-compose.yml b/monit/docker-compose.yml new file mode 100644 index 0000000..220c2ee --- /dev/null +++ b/monit/docker-compose.yml @@ -0,0 +1,7 @@ +monit: + image: vimagick/monit + volumes: + - monit:/etc/monit + pid: host + net: host + restart: always diff --git a/monit/monit/conf.d/settings.cfg b/monit/monit/conf.d/settings.cfg new file mode 100644 index 0000000..006e709 --- /dev/null +++ b/monit/monit/conf.d/settings.cfg @@ -0,0 +1,3 @@ +set httpd port 2812 and + use address 0.0.0.0/0 + allow admin:monit diff --git a/monit/monit/monitrc b/monit/monit/monitrc new file mode 100644 index 0000000..e861823 --- /dev/null +++ b/monit/monit/monitrc @@ -0,0 +1,10 @@ +############################################################################### +## Monit control file +############################################################################### + +set daemon 30 +set logfile /dev/stdout +set pidfile /var/run/monit.pid +set idfile /var/lib/monit/monit.id +set statefile /var/lib/monit/monit.state +include /etc/monit/conf.d/*