1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

docker_cpu: fix warnings when docker ps has empty list

This commit is contained in:
Andreas Perhab 2020-07-24 14:02:30 +02:00 committed by Lars Kruse
parent 0853d409f3
commit 260c8c8ff4

View file

@ -86,9 +86,9 @@ for my $i (1 .. $#containers)
if (defined $ARGV[0] and $ARGV[0] eq "config")
{
my $nanoSecondsInSecond=1000000000;
my $graphlimit = $result[0]{'ncpu'};
my $graphlimit = 1;
foreach(@result){
if ($$_{'ncpu'} > $graphlimit){
if ($$_{'ncpu'} || 1 > $graphlimit){
$graphlimit = $$_{'ncpu'};
}
}