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

Docker Plugin

Ignore containers in weird state.
This commit is contained in:
Samuel Cantero 2016-01-04 22:42:47 -03:00
parent ae03bc6fb8
commit 0a5f6adf2c
2 changed files with 18 additions and 12 deletions

View file

@ -66,10 +66,12 @@ for my $i (1 .. $#containers)
$name =~ s/[-\+*\/\.]/_/g;
# truncate container name with "," character.
$name =~ s/,.*//g;
open(my $file, '<', "/sys/fs/cgroup/memory/docker/$id/memory.usage_in_bytes") or die "Unable to open file, $!";
my $memory_bytes = <$file>;
$memory_bytes =~ s/\s+$//;
push @result, {'name'=>$name, 'memory_bytes'=>$memory_bytes};
if (open(my $file, '<', "/sys/fs/cgroup/memory/docker/$id/memory.usage_in_bytes"))
{
my $memory_bytes = <$file>;
$memory_bytes =~ s/\s+$//;
push @result, {'name'=>$name, 'memory_bytes'=>$memory_bytes};
}
}
if (defined $ARGV[0] and $ARGV[0] eq "config")