rc1 mysql recon

Former-commit-id: 51e000229d6c2c94e59e8eeb8ef77d539ee6c775
This commit is contained in:
fbsanchez 2019-04-04 16:00:08 +02:00
parent fcafe76943
commit ce9f9eab4e
2 changed files with 21 additions and 3 deletions

View File

@ -459,8 +459,8 @@ sub PandoraFMS::Recon::Base::create_agents($$) {
$agent_id = pandora_create_agent(
$pa_config, $pa_config->{'servername'}, $agent->{'agent_name'},
$agent->{'address'}, $agent->{'id_group'}, $parent_id,
$agent->{'os'}, $agent->{'description'}, $agent->{'interval'},
$dbh, $agent->{'timezone_offset'}
get_os_id($dbh, $agent->{'os'}), $agent->{'description'},
$agent->{'interval'}, $dbh, $agent->{'timezone_offset'}
);
$current_agent = $parent_id = PandoraFMS::Core::locate_agent(

View File

@ -1475,6 +1475,8 @@ sub db_scan($) {
};
} else {
my $dbObjCfg = $dbObj->get_config();
$self->{'summary'}->{'discovered'} += 1;
$self->{'summary'}->{'alive'} += 1;
@ -1499,10 +1501,26 @@ sub db_scan($) {
push @modules, $dbObj->get_statistics();
$self->call('update_progress', 50);
# Custom queries.
push @modules, $dbObj->execute_custom_queries();
$self->call('update_progress', 90);
if (defined($dbObjCfg->{'scan_databases'})
&& $dbObjCfg->{'scan_databases'} == 1) {
my $__data = $dbObj->scan_databases();
if (ref($__data) eq "ARRAY") {
if (defined($dbObjCfg->{'agent_per_database'})
&& $dbObjCfg->{'agent_per_database'} == 1) {
# Agent per database detected.
push @data, @{$__data};
} else {
# Merge modules into engine agent.
my @_modules = map { $_->{'module_data'} } @{$__data};
push @modules, @_modules;
}
}
}
}
# Put engine agent at the beginning of the list.