From 2dea3b365c6a4fb0a41b24b285e387fa450dc9ac Mon Sep 17 00:00:00 2001 From: darode Date: Tue, 6 Jul 2010 15:06:00 +0000 Subject: [PATCH] 2010-07-06 Dario Rodriguez * lib/PandoraFMS/Core.pm, ReconServer.pm, DataServer.pm: Delete $address_id paremeter from function pandora_create_agent() * util/pandora_manage.pl: Delete $address_id paremeter from function pandora_create_agent() Fixes bug #3006770 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2967 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 9 +++++++++ pandora_server/lib/PandoraFMS/Core.pm | 6 +++--- pandora_server/lib/PandoraFMS/DataServer.pm | 4 ++-- pandora_server/lib/PandoraFMS/ReconServer.pm | 13 +++++++------ pandora_server/util/pandora_manage.pl | 2 +- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 7a58a3f10c..8291daf316 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,12 @@ +2010-07-06 Dario Rodriguez + + * lib/PandoraFMS/Core.pm, ReconServer.pm, DataServer.pm: Delete + $address_id paremeter from function pandora_create_agent() + + * util/pandora_manage.pl: Delete $address_id paremeter from function + pandora_create_agent() + Fixes bug #3006770 + 2010-07-05 Junichi Satoh * pandora_server_installer: Added support for FreeBSD. diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index d52194d3fa..a7d4b846af 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1073,15 +1073,15 @@ sub pandora_create_module ($$$$$$$$$$) { } ########################################################################## -=head2 C<< pandora_create_agent (I<$pa_config>, I<$server_name>, I<$agent_name>, I<$address>, I<$address_id>, I<$group_id>, I<$parent_id>, I<$os_id>, I<$description>, I<$interval>, I<$dbh>, [I<$timezone_offset>], [I<$longitude>], [I<$latitude>], [I<$altitude>], [I<$position_description>]) >> +=head2 C<< pandora_create_agent (I<$pa_config>, I<$server_name>, I<$agent_name>, I<$address>, I<$group_id>, I<$parent_id>, I<$os_id>, I<$description>, I<$interval>, I<$dbh>, [I<$timezone_offset>], [I<$longitude>], [I<$latitude>], [I<$altitude>], [I<$position_description>]) >> Create a new entry in B optionaly with position information =cut ########################################################################## -sub pandora_create_agent ($$$$$$$$$$$;$$$$$) { +sub pandora_create_agent ($$$$$$$$$$;$$$$$) { my ($pa_config, $server_name, $agent_name, $address, - $address_id, $group_id, $parent_id, $os_id, + $group_id, $parent_id, $os_id, $description, $interval, $dbh, $timezone_offset, $longitude, $latitude, $altitude, $position_description) = @_; diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index e0a3b4771d..5d7e944e26 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -264,12 +264,12 @@ sub process_xml_data ($$$$$) { # Create the agent if ($valid_position_data == 1 && $pa_config->{'activate_gis'} != 0 ) { logger($pa_config, "Creating agent $agent_name at long: $longitude lat: $latitude alt: $altitude", 5); - $agent_id = pandora_create_agent($pa_config, $pa_config->{'servername'}, $agent_name, '', 0, $group_id, $parent_id, $os, + $agent_id = pandora_create_agent($pa_config, $pa_config->{'servername'}, $agent_name, '', $group_id, $parent_id, $os, $description, $interval, $dbh, $timezone_offset, $longitude, $latitude, $altitude, $position_description); } else { # Ignore agent positional data logger($pa_config, "Creating agent $agent_name", 5); - $agent_id = pandora_create_agent($pa_config, $pa_config->{'servername'}, $agent_name, '', 0, $group_id, $parent_id, $os, + $agent_id = pandora_create_agent($pa_config, $pa_config->{'servername'}, $agent_name, '', $group_id, $parent_id, $os, $description, $interval, $dbh, $timezone_offset); } if (! defined ($agent_id)) { diff --git a/pandora_server/lib/PandoraFMS/ReconServer.pm b/pandora_server/lib/PandoraFMS/ReconServer.pm index c6bf90e1b5..fd99216184 100644 --- a/pandora_server/lib/PandoraFMS/ReconServer.pm +++ b/pandora_server/lib/PandoraFMS/ReconServer.pm @@ -204,22 +204,23 @@ sub data_consumer ($$) { logger($pa_config, "Placing agent on random position (Lon,Lat) = ($longitude, $latitude)", 8); # Crate a new agent adding the positional info (as is unknown we set 0 time_offset, and 0 altitude) $agent_id = pandora_create_agent ($pa_config, $pa_config->{'servername'}, - $host_name, $addr, $addr_id, - $task->{'id_group'}, $parent_id, $id_os, '', 300, $dbh, 0, $longitude, $latitude, 0, $location_description); + $host_name, $addr, $task->{'id_group'}, + $parent_id, $id_os, '', 300, $dbh, 0, + $longitude, $latitude, 0, $location_description); } else { logger($pa_config,"Id location of '$addr' for host '$host_name' NOT found", 3); # Crate a new agent $agent_id = pandora_create_agent ($pa_config, $pa_config->{'servername'}, - $host_name, $addr, $addr_id, - $task->{'id_group'}, $parent_id, $id_os, '', 300, $dbh); + $host_name, $addr, $task->{'id_group'}, + $parent_id, $id_os, '', 300, $dbh); } } else { # Crate a new agent $agent_id = pandora_create_agent ($pa_config, $pa_config->{'servername'}, - $host_name, $addr, $addr_id, - $task->{'id_group'}, $parent_id, $id_os, '', 300, $dbh); + $host_name, $addr, $task->{'id_group'}, + $parent_id, $id_os, '', 300, $dbh); } # Assign the new address to the agent diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ddd9b859db..d86aec7df5 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -689,7 +689,7 @@ sub pandora_manage_main ($$$) { exist_check($id_group,'group',$group_name); my $os_id = get_os_id($dbh,$os_name); exist_check($id_group,'operating system',$group_name); - pandora_create_agent ($conf, $server_name, $agent_name, $address, 0, $id_group, 0, $os_id, $description, $interval, $dbh); + pandora_create_agent ($conf, $server_name, $agent_name, $address, $id_group, 0, $os_id, $description, $interval, $dbh); } elsif ($param =~ m/--delete_agent/i) { param_check($ltotal, 1);