Files
tpotce/installer/bin/status.sh

46 lines
1.0 KiB
Bash
Raw Normal View History

2015-01-27 17:46:52 +01:00
#!/bin/bash
# Show status of SupervisorD within running containers
2015-01-27 17:46:52 +01:00
myCOUNT=1
if [[ $1 == "" ]]
then
myIMAGES=$(cat /etc/tpot/tpot.yml | grep container_name | cut -d: -f2)
else myIMAGES=$1
fi
2015-01-27 17:46:52 +01:00
while true
2015-08-07 23:45:50 +02:00
do
2015-01-30 21:40:01 +01:00
if ! [ -a /var/run/check.lock ];
2015-01-27 17:46:52 +01:00
then break
fi
sleep 0.1
if [ $myCOUNT = 1 ];
then
echo -n "Waiting for services "
else echo -n .
fi
2015-01-28 17:08:34 +01:00
if [ $myCOUNT = 300 ];
then
echo
echo "Services are busy or not available. Please retry later."
exit 1
fi
2015-01-27 17:46:52 +01:00
myCOUNT=$[$myCOUNT +1]
done
echo
echo
2015-12-08 15:47:39 +01:00
echo "======| System |======"
echo Date:" "$(date)
echo Uptime:" "$(uptime)
echo CPU temp: $(sensors | grep "Physical" | awk '{ print $4 }')
2015-01-27 17:46:52 +01:00
echo
2015-01-28 17:08:34 +01:00
for i in $myIMAGES
2015-08-07 23:45:50 +02:00
do
if [ "$i" != "ui-for-docker" ] && [ "$i" != "netdata" ] && [ "$i" != "spiderfoot" ];
then
echo "======| Container:" $i "|======"
docker exec $i supervisorctl status | GREP_COLORS='mt=01;32' egrep --color=always "(RUNNING)|$" | GREP_COLORS='mt=01;31' egrep --color=always "(STOPPED|FATAL)|$"
echo
fi
2015-01-27 17:46:52 +01:00
done