Notify a Teams channel when docker containers are down. Keeps track of containers that are down and notifies only once, and again when they are back up.
cp config.sh.example config.shteamsWebhookUrl='https://teams.microsoft.com/webhook'
listOfContainers="mycontainer1 mycontainer2"./start.shTo work with a schedule to execute this script you can set following below.
- Set the env
TEAMS_CONTAINER_NOTIFIER_DIRglobally to current dir
sudo sh -c "echo \"TEAMS_CONTAINER_NOTIFIER_DIR=$(pwd)\" >> /etc/environment"- Add scheduled job
crontab -e
*/5 * * * * sh -c "$TEAMS_CONTAINER_NOTIFIER_DIR/start.sh"grep CRON /var/log/syslog
# or
tail -f /var/log/syslog | grep CRON