diff --git a/pandora_agents/unix/ChangeLog b/pandora_agents/unix/ChangeLog index e5987ffe85..d408d9cf23 100644 --- a/pandora_agents/unix/ChangeLog +++ b/pandora_agents/unix/ChangeLog @@ -1,3 +1,7 @@ +2013-04-17 Ramon Novoa + + * pandora_agent: Added support for sending multiple ip addresses. + 2013-04-12 Ramon Novoa * pandora_agent: Added macro support to all module configuration diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index ee198f071b..4a2e90a068 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -2030,8 +2030,15 @@ 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 - $address = `ifconfig -a | grep -v '127.0.0' | grep '[0-9]*\\.[0-9]*\\.[0-9]*' | awk '{ print \$2 }' | head -1 | sed -e 's/addr\\://' | sed -e 's/inet\\://'`; - chomp($address); + my @address_list = `ifconfig -a | grep -v '127.0.0' | grep '[0-9]*\\.[0-9]*\\.[0-9]*' | awk '{ print \$2 }' | sed -e 's/addr\\://' | sed -e 's/inet\\://'`; + for (my $i = 0; $i <= $#address_list; $i++) { + chomp($address_list[$i]); + if ($i > 0) { + $address .= ','; + } + + $address .= $address_list[$i]; + } } else { $address = $Conf{'address'};