2010-07-06 Dario Rodriguez <dario.rodriguez@artica.es>
* 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
This commit is contained in:
parent
7095a1626b
commit
2dea3b365c
|
@ -1,3 +1,12 @@
|
|||
2010-07-06 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||
|
||||
* 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 <junichi@rworks.jp>
|
||||
|
||||
* pandora_server_installer: Added support for FreeBSD.
|
||||
|
|
|
@ -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<tagente> 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) = @_;
|
||||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue