containerized-monitoring/run.sh

39 lines
1.2 KiB
Bash
Raw Normal View History

2024-04-24 22:11:05 +00:00
#!/bin/bash
echo "**** Building latest monitoring container ****"
2024-04-24 22:11:05 +00:00
$(pwd)/build.sh
echo "**** Loading secrets.sh ****"
source ./secrets.sh
echo "**** Deleting existing container ****"
sudo docker rm -f containerized-monitoring
2024-04-24 22:11:05 +00:00
echo "**** Running monitoring ****"
2024-04-24 22:11:05 +00:00
sudo docker run -itd \
--restart unless-stopped \
--network services \
--name containerized-monitoring \
2024-04-24 22:11:05 +00:00
-e TZ=UTC \
-e DEBUG=1 \
-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 \
-p 80:80/tcp \
2024-04-24 22:11:05 +00:00
-l diun.enable=true \
-l traefik.enable=false \
-v /var/containerized-monitoring/monit:/opt/monit \
-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 \
containerized-monitoring:latest
docker logs -f --since=1m containerized-monitoring