From be3c0077d3c42cb565e692b412fb9884b52c7eb9 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Tue, 28 Jun 2011 09:47:10 +0000 Subject: [PATCH] 2011-06-28 Sergio Martin * unix/Linux/pandora_agent.conf unix/pandora_agent: Changed the ip_address token name to address to compatibility with the server works git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4491 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/ChangeLog | 6 ++++++ pandora_agents/unix/Linux/pandora_agent.conf | 4 ++-- pandora_agents/unix/pandora_agent | 18 +++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index f9fe68443b..456ece4cab 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,9 @@ +2011-06-28 Sergio Martin + + * unix/Linux/pandora_agent.conf + unix/pandora_agent: Changed the ip_address token name + to address to compatibility with the server works + 2011-06-28 Sergio Martin * unix/Linux/pandora_agent.conf diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 7546adf981..9640066f2d 100755 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -40,8 +40,8 @@ udp_server_auth_address 0.0.0.0 # Group assigned for this agent (descriptive, p.e: Servers) #group Servers -# ip_address: Enforce to server a ip address to this agent -#ip_address 192.168.36.73 +# address: Enforce to server a ip address to this agent +#address 192.168.36.73 # Autotime: Enforce to server to ignore timestamp coming from this # agent, used when agents has no timer or it's inestable. 1 to enable diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 0141af1d80..b94caff1c6 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1586,16 +1586,16 @@ while (1) { # Check file collections check_collections () unless ($Conf{'debug'} eq '1'); - my $ip_address; + my $address; - if(defined($Conf{'ip_address'})) { - # Check if ip_address is auto to get the local ip - if ($Conf{'ip_address'} eq 'auto') { - $ip_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($ip_address); + if(defined($Conf{'address'})) { + # Check if address is auto to get the local ip + if ($Conf{'address'} eq 'auto') { + $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); } else { - $ip_address = $Conf{'ip_address'}; + $address = $Conf{'address'}; } } @@ -1605,8 +1605,8 @@ while (1) { "' version='" . AGENT_VERSION . '(Build ' . AGENT_BUILD . ')' . ($Conf{'autotime'} eq '1' ? '' : "' timestamp='" . strftime ('%Y/%m/%d %H:%M:%S', localtime ())) . "' agent_name='" . $Conf{'agent_name'} . "' timezone_offset='". $Conf{'timezone_offset'}; - if (defined ($Conf{'ip_address'})) { - $Xml .= "' ip_address='" .$ip_address; + if (defined ($Conf{'address'})) { + $Xml .= "' address='" .$address; } if (defined ($Conf{'parent_agent_name'})) {