mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
2009-12-23 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm, lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm: Use agent provided interval for agent auto creation. The default interval was being used instead. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2237 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
ba6935ebff
commit
e154d0613f
@ -1,3 +1,10 @@
|
|||||||
|
2009-12-23 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* lib/PandoraFMS/Core.pm,
|
||||||
|
lib/PandoraFMS/ReconServer.pm,
|
||||||
|
lib/PandoraFMS/DataServer.pm: Use agent provided interval for agent
|
||||||
|
auto creation. The default interval was being used instead.
|
||||||
|
|
||||||
2009-12-23 Sancho Lerena <slerena@artica.es>
|
2009-12-23 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/Core.pm: Fixed some typos in planned downtime subroutine.
|
* lib/PandoraFMS/Core.pm: Fixed some typos in planned downtime subroutine.
|
||||||
|
@ -802,17 +802,17 @@ sub pandora_create_module ($$$$$$$$$$) {
|
|||||||
##########################################################################
|
##########################################################################
|
||||||
# Create a new entry in tagente.
|
# Create a new entry in tagente.
|
||||||
##########################################################################
|
##########################################################################
|
||||||
sub pandora_create_agent ($$$$$$$$$$) {
|
sub pandora_create_agent ($$$$$$$$$$$) {
|
||||||
my ($pa_config, $server_name, $agent_name, $address,
|
my ($pa_config, $server_name, $agent_name, $address,
|
||||||
$address_id, $group_id, $parent_id, $os_id,
|
$address_id, $group_id, $parent_id, $os_id,
|
||||||
$description, $dbh) = @_;
|
$description, $interval, $dbh) = @_;
|
||||||
|
|
||||||
logger ($pa_config, "Server '$server_name' creating agent '$agent_name' address '$address'.", 10);
|
logger ($pa_config, "Server '$server_name' creating agent '$agent_name' address '$address'.", 10);
|
||||||
|
|
||||||
$description = "Created by $server_name" unless ($description ne '');
|
$description = "Created by $server_name" unless ($description ne '');
|
||||||
|
|
||||||
my $agent_id = db_insert ($dbh, 'INSERT INTO tagente (`nombre`, `direccion`, `comentarios`, `id_grupo`, `id_os`, `server_name`, `intervalo`, `id_parent`, `modo`)
|
my $agent_id = db_insert ($dbh, 'INSERT INTO tagente (`nombre`, `direccion`, `comentarios`, `id_grupo`, `id_os`, `server_name`, `intervalo`, `id_parent`, `modo`)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, 300, ?, 1)', $agent_name, $address, $description, $group_id, $os_id, $server_name, $parent_id);
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, 1)', $agent_name, $address, $description, $group_id, $os_id, $server_name, $interval, $parent_id);
|
||||||
|
|
||||||
pandora_event ($pa_config, "Agent '$agent_name' created by $server_name", $pa_config->{'autocreate_group'}, $agent_id, 2, 0, 0, 'new_agent', $dbh);
|
pandora_event ($pa_config, "Agent '$agent_name' created by $server_name", $pa_config->{'autocreate_group'}, $agent_id, 2, 0, 0, 'new_agent', $dbh);
|
||||||
return $agent_id;
|
return $agent_id;
|
||||||
|
@ -191,7 +191,7 @@ sub process_xml_data ($$$$$) {
|
|||||||
$description = $data->{'description'} if (defined ($data->{'description'}));
|
$description = $data->{'description'} if (defined ($data->{'description'}));
|
||||||
|
|
||||||
# Create the agent
|
# Create the agent
|
||||||
$agent_id = pandora_create_agent ($pa_config, $pa_config->{'servername'}, $agent_name, '', 0, $group_id, 0, $os, $description, $dbh);
|
$agent_id = pandora_create_agent ($pa_config, $pa_config->{'servername'}, $agent_name, '', 0, $group_id, 0, $os, $description, $interval, $dbh);
|
||||||
if (! defined ($agent_id)) {
|
if (! defined ($agent_id)) {
|
||||||
$AgentSem->up ();
|
$AgentSem->up ();
|
||||||
return;
|
return;
|
||||||
|
@ -167,7 +167,7 @@ sub data_consumer ($$) {
|
|||||||
# Crate a new agent
|
# Crate a new agent
|
||||||
my $agent_id = pandora_create_agent ($pa_config, $pa_config->{'servername'},
|
my $agent_id = pandora_create_agent ($pa_config, $pa_config->{'servername'},
|
||||||
$host_name, $addr, $addr_id,
|
$host_name, $addr, $addr_id,
|
||||||
$task->{'id_group'}, $parent_id, $id_os, '', $dbh);
|
$task->{'id_group'}, $parent_id, $id_os, '', 300, $dbh);
|
||||||
# Assign the new address to the agent
|
# Assign the new address to the agent
|
||||||
db_insert ($dbh, 'INSERT INTO taddress_agent (`id_a`, `id_agent`)
|
db_insert ($dbh, 'INSERT INTO taddress_agent (`id_a`, `id_agent`)
|
||||||
VALUES (?, ?)', $addr_id, $agent_id);
|
VALUES (?, ?)', $addr_id, $agent_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user