Projet

Général

Profil

Révision 0a5f6adf

ID0a5f6adf2cf5209a9b7a543f39a3ac4125b19945
Parent ae03bc6f
Enfant 65e4a94c

Ajouté par Samuel Cantero il y a presque 10 ans

Docker Plugin

Ignore containers in weird state.

Voir les différences:

plugins/docker/docker_memory
66 66
   $name =~ s/[-\+*\/\.]/_/g;
67 67
   # truncate container name with "," character.
68 68
   $name =~ s/,.*//g;
69
   open(my $file, '<', "/sys/fs/cgroup/memory/docker/$id/memory.usage_in_bytes") or die "Unable to open file, $!";
70
   my $memory_bytes = <$file>;
71
   $memory_bytes =~ s/\s+$//;
72
   push @result, {'name'=>$name, 'memory_bytes'=>$memory_bytes}; 
69
   if (open(my $file, '<', "/sys/fs/cgroup/memory/docker/$id/memory.usage_in_bytes"))
70
   {
71
      my $memory_bytes = <$file>;
72
      $memory_bytes =~ s/\s+$//;
73
      push @result, {'name'=>$name, 'memory_bytes'=>$memory_bytes};
74
   }
73 75
}
74 76

  
75 77
if (defined $ARGV[0] and $ARGV[0] eq "config")

Formats disponibles : Unified diff