diff --git a/check_docker_info b/check_docker_info index e558395b6ac36767a7d3f2080a00d6844eaaf272..06947defe4a3da083e6d84a63877d9b681626c22 100755 --- a/check_docker_info +++ b/check_docker_info @@ -151,7 +151,7 @@ ph.perfadd "images" "$iImages" ph.status "Docker $sVersion ($sLicense) .. containers: $iCTotal running: $iCRunning paused: $iCPaused stopped: $iCStopped .. images: $iImages" echo "$out" -if [ $bOptContainers -eq 1 ]; then +if [ $bOptContainers -eq 1 ] && [ "$iCTotal" -gt "0" ]; then echo echo "Containers:" containers=$( sudo -n --preserve-env docker ps --all --format "{{ json . }}" --all 2>/dev/null )