Fixed running containers calculation

This commit is contained in:
Diogo Monica 2015-05-13 19:43:12 -07:00
parent 1c795f146e
commit 8d06000296

View file

@ -48,7 +48,7 @@ fi
# 6.7 # 6.7
check_6_7="6.7 - Avoid container sprawl" check_6_7="6.7 - Avoid container sprawl"
total_containers=`docker info 2>/dev/null | grep "Containers" | awk '{print $2}'` total_containers=`docker info 2>/dev/null | grep "Containers" | awk '{print $2}'`
running_containers=`printf $containers | wc -l | awk '{print $1}'` running_containers=`docker ps -q | wc -l | awk '{print $1}'`
diff=`expr "$total_containers" - "$running_containers"` diff=`expr "$total_containers" - "$running_containers"`
if [ $diff -gt 25 ]; then if [ $diff -gt 25 ]; then
warn "$check_6_7" warn "$check_6_7"