2024-04-24 22:11:05 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-04-25 12:57:43 +00:00
|
|
|
echo "**** Building latest monitoring container ****"
|
2024-04-24 22:11:05 +00:00
|
|
|
$(pwd)/build.sh
|
|
|
|
|
2024-04-25 14:27:16 +00:00
|
|
|
echo "**** Loading secrets.sh ****"
|
|
|
|
source ./secrets.sh
|
|
|
|
|
2024-04-25 12:57:43 +00:00
|
|
|
echo "**** Deleting existing container ****"
|
2024-04-25 14:27:16 +00:00
|
|
|
sudo docker rm -f containerized-monitoring
|
2024-04-24 22:11:05 +00:00
|
|
|
|
2024-04-25 12:57:43 +00:00
|
|
|
echo "**** Running monitoring ****"
|
2024-04-24 22:11:05 +00:00
|
|
|
sudo docker run -itd \
|
|
|
|
--restart unless-stopped \
|
|
|
|
--network services \
|
2024-04-25 12:57:43 +00:00
|
|
|
--name containerized-monitoring \
|
2024-04-24 22:11:05 +00:00
|
|
|
-e TZ=UTC \
|
|
|
|
-e DEBUG=1 \
|
2024-04-25 14:27:16 +00:00
|
|
|
-e CONFIG_NOTIFY_EMAIL=$CONFIG_NOTIFY_EMAIL \
|
|
|
|
-e CONFIG_NOTIFY_SMTP_SERVER=$CONFIG_NOTIFY_SMTP_SERVER \
|
|
|
|
-e CONFIG_NOTIFY_SMTP_USER=$CONFIG_NOTIFY_SMTP_USER \
|
|
|
|
-e CONFIG_NOTIFY_SMTP_PASS=$CONFIG_NOTIFY_SMTP_PASS \
|
|
|
|
-e CONFIG_MONIT_USER=$CONFIG_MONIT_USER \
|
|
|
|
-e CONFIG_MONIT_PASS=$CONFIG_MONIT_PASS \
|
|
|
|
-p 2812:2812/tcp \
|
2024-04-24 22:11:05 +00:00
|
|
|
-p 2813:2813/tcp \
|
2024-04-25 14:27:16 +00:00
|
|
|
-p 80:80/tcp \
|
2024-04-24 22:11:05 +00:00
|
|
|
-l diun.enable=true \
|
|
|
|
-l traefik.enable=false \
|
2024-04-25 14:27:16 +00:00
|
|
|
-v /var/containerized-monitoring/monit:/opt/monit \
|
2024-04-25 12:57:43 +00:00
|
|
|
-v /var/containerized-monitoring/munin:/opt/munin \
|
2024-04-24 22:11:05 +00:00
|
|
|
--mount type=tmpfs,destination=/opt/munin/www \
|
|
|
|
--mount type=tmpfs,destination=/opt/munin/log \
|
|
|
|
--mount type=tmpfs,destination=/opt/munin/run \
|
|
|
|
--mount type=tmpfs,destination=/opt/munin/cgi-tmp \
|
2024-04-25 12:57:43 +00:00
|
|
|
containerized-monitoring:latest
|
|
|
|
|
|
|
|
docker logs -f --since=1m containerized-monitoring
|