[init] initial commit

This commit is contained in:
2023-06-05 23:04:30 +08:00
commit 66b1dd4d70
72 changed files with 10079 additions and 0 deletions

12
alert/docker_alarm.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
docker ps -a --format "table {{.Names}}\t{{.Status}}" > /opt/logs/docker_status.log
while read line; do
echo $line | grep -q 'Exited'
if [[ $? -eq 0 ]]; then
name=`echo $line | awk '{print $1}'`
alarm="Docker Alarm - $name:\nContainer $name has been off line, please check ASAP."
bash /opt/scripts/alert/sendmsg.sh "$alarm"
fi
done < /opt/logs/docker_status.log