From ae03bc6fb886836cf16376acf6c65b4cedd16678 Mon Sep 17 00:00:00 2001 From: Samuel Cantero Date: Sun, 25 Oct 2015 18:04:02 -0300 Subject: [PATCH] Docker plugin Fix autoconf support --- plugins/docker/docker_cpu | 17 ++++++++++++++++- plugins/docker/docker_memory | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/plugins/docker/docker_cpu b/plugins/docker/docker_cpu index 7a30fad9..c9b7e642 100755 --- a/plugins/docker/docker_cpu +++ b/plugins/docker/docker_cpu @@ -39,7 +39,22 @@ GPLv3 =cut -my @containers = split "\n" , `/usr/bin/docker ps --no-trunc=true`; +my $docker=`which docker`; + +if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" ) { + if ($docker) { + print "yes\n"; + exit 0; + } + else{ + print "no (Docker has not been found)\n"; + exit 0; + } +} + +$docker =~ s/\s+$//; + +my @containers = split "\n" , `$docker ps --no-trunc=true`; my $result; for my $i (1 .. $#containers) diff --git a/plugins/docker/docker_memory b/plugins/docker/docker_memory index d48b0fc8..b4cb3cc9 100755 --- a/plugins/docker/docker_memory +++ b/plugins/docker/docker_memory @@ -39,7 +39,22 @@ GPLv3 =cut -my @containers = split "\n" , `/usr/bin/docker ps --no-trunc=true`; +my $docker=`which docker`; + +if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" ) { + if ($docker) { + print "yes\n"; + exit 0; + } + else{ + print "no (Docker has not been found)\n"; + exit 0; + } +} + +$docker =~ s/\s+$//; + +my @containers = split "\n" , `$docker ps --no-trunc=true`; my $result; for my $i (1 .. $#containers)