From f2b7f898fdc73d8553cf29ecf747fadc26561ec5 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 10 Jul 2013 10:08:52 +0000 Subject: [PATCH] 2013-07-10 Ramon Novoa * pandora_agent: Changed the regexp used to retrieve ip addresses to avoid locale related problems. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8507 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/unix/ChangeLog | 5 +++++ pandora_agents/unix/pandora_agent | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_agents/unix/ChangeLog b/pandora_agents/unix/ChangeLog index 4bc33c4ddc..9d525d3b4e 100644 --- a/pandora_agents/unix/ChangeLog +++ b/pandora_agents/unix/ChangeLog @@ -1,3 +1,8 @@ +2013-07-10 Ramon Novoa + + * pandora_agent: Changed the regexp used to retrieve ip addresses to + avoid locale related problems. + 2013-07-03 Ramon Novoa * pandora_agent.redhat.spec: Make absolute calls to chkconfig. Add the diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index d7b8598d04..72c5d6b4a9 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -2086,7 +2086,7 @@ 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 }' | sed -e 's/addr\\://' | sed -e 's/inet\\://'`; + my @address_list = `ifconfig -a | grep -v '127.0.0' | grep '[0-9]*\\.[0-9]*\\.[0-9]*' | awk '{ print \$2 }' | awk -F':' '{ print \$2 }'`; for (my $i = 0; $i <= $#address_list; $i++) { chomp($address_list[$i]); if ($i > 0) {