2013-06-24 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/ReconServer.pm: Merged from 4.0 branch. Fixed a call
	  to get_agent_from_addr that prevented parents from being properly
	  detected.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8378 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2013-06-24 11:07:21 +00:00
parent 0bb6eaa9d0
commit 307788383b
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2013-06-24 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/ReconServer.pm: Merged from 4.0 branch. Fixed a call
to get_agent_from_addr that prevented parents from being properly
detected.
2013-06-19 Hirofumi Kosaka <kosaka@rworks.jp>
* lib/PandoraFMS/Config.pm,

View File

@ -351,10 +351,10 @@ sub get_host_parent {
my $host_addr = $hop->ipaddr ();
# Check if the host exists
my $agent_id = get_agent_from_addr ($dbh, $host_addr);
if (defined ($agent_id)) {
my $agent = get_agent_from_addr ($dbh, $host_addr);
if (defined ($agent)) {
# Move to the next host
$parent_id = $agent_id;
$parent_id = $agent->{'id_agente'};
next;
}
@ -383,7 +383,7 @@ sub get_host_parent {
}
# Create the host
$agent_id = pandora_create_agent ($pa_config, $pa_config->{'servername'}, $host_name, $host_addr, $group, $parent_id, $id_os, '', 300, $dbh);
my $agent_id = pandora_create_agent ($pa_config, $pa_config->{'servername'}, $host_name, $host_addr, $group, $parent_id, $id_os, '', 300, $dbh);
$agent_id = 0 unless defined ($parent_id);
db_do ($dbh, 'INSERT INTO taddress_agent (`id_a`, `id_agent`)
VALUES (?, ?)', $addr_id, $agent_id);