2013-04-17 Ramon Novoa <rnovoa@artica.es>

* pandora_agent: Added support for sending multiple ip addresses.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7999 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2013-04-17 10:44:32 +00:00
parent 094bbfc5df
commit 86eaf4700e
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2013-04-17 Ramon Novoa <rnovoa@artica.es>
* pandora_agent: Added support for sending multiple ip addresses.
2013-04-12 Ramon Novoa <rnovoa@artica.es>
* pandora_agent: Added macro support to all module configuration

View File

@ -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'};