From c5494cc1d9368db2b4e50bb2b39866a23288c5f0 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Fri, 24 Oct 2014 15:23:21 +0200 Subject: [PATCH] Removed ifconfig and ip addr error messages from the output. --- pandora_agents/unix/pandora_agent | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index ffa0093aeb..f9038bacd3 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -2166,10 +2166,10 @@ while (1) { # Check if address is auto to get the local ip if ($Conf{'address'} eq 'auto') { # Tested on Ubuntu, debian, Suse, Solaris 10 and AIX 5.1 - my @address_list = `ifconfig -a | grep -v '127.0.0' | grep '[0-9]*\\.[0-9]*\\.[0-9]*' | awk '{ print \$2 }' | awk -F':' '{ print \$2 }'`; + my @address_list = `ifconfig -a 2>$DevNull | grep -v '127.0.0' | grep '[0-9]*\\.[0-9]*\\.[0-9]*' | awk '{ print \$2 }' | awk -F':' '{ print \$2 }'`; if ($#address_list < 0) { # Tested on Red Hat 7 - @address_list = `ip addr show | grep -v '127.0.0' | grep '[0-9]*\\.[0-9]*\\.[0-9]*' | awk '{print \$2}' | cut -d/ -f1`; + @address_list = `ip addr show 2>$DevNull | grep -v '127.0.0' | grep '[0-9]*\\.[0-9]*\\.[0-9]*' | awk '{print \$2}' | cut -d/ -f1`; } for (my $i = 0; $i <= $#address_list; $i++) { chomp($address_list[$i]);