mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch '1674-Sincronizacion-de-agentes-inmediata-con-metaconsola-en-operación-masiva' into 'develop'
Update metaconsole after agent bulk operations for update - #1674 See merge request artica/pandorafms!1174
This commit is contained in:
commit
bc6b660592
@ -135,8 +135,7 @@ if ($update_agents) {
|
|||||||
$result = false;
|
$result = false;
|
||||||
foreach ($id_agents as $id_agent) {
|
foreach ($id_agents as $id_agent) {
|
||||||
if (!empty($values)) {
|
if (!empty($values)) {
|
||||||
if ($config['metaconsole_agent_cache'] == 1 &&
|
if ($config['metaconsole_agent_cache'] == 1) {
|
||||||
isset($values['id_grupo'])) {
|
|
||||||
$values['update_module_count'] = 1; // Force an update of the agent cache.
|
$values['update_module_count'] = 1; // Force an update of the agent cache.
|
||||||
}
|
}
|
||||||
$group_old = false;
|
$group_old = false;
|
||||||
|
@ -293,7 +293,7 @@ sub pandora_server_tasks ($) {
|
|||||||
if (($counter % 30) == 0) {
|
if (($counter % 30) == 0) {
|
||||||
|
|
||||||
# Update module status and fired alert counts
|
# Update module status and fired alert counts
|
||||||
my @agents = get_db_rows ($dbh, 'SELECT id_agente, nombre, update_module_count, update_alert_count FROM tagente WHERE disabled = 0 AND (update_module_count=1 OR update_alert_count=1)');
|
my @agents = get_db_rows ($dbh, 'SELECT id_agente, nombre, update_module_count, update_alert_count FROM tagente WHERE (update_module_count=1 OR update_alert_count=1)');
|
||||||
foreach my $agent (@agents) {
|
foreach my $agent (@agents) {
|
||||||
logger ($pa_config, "Updating module status and fired alert counts for agent " . $agent->{'nombre'}, 10);
|
logger ($pa_config, "Updating module status and fired alert counts for agent " . $agent->{'nombre'}, 10);
|
||||||
|
|
||||||
|
@ -5155,7 +5155,7 @@ sub pandora_update_agent_module_count ($$$) {
|
|||||||
}; # Module counts by status.
|
}; # Module counts by status.
|
||||||
|
|
||||||
# Retrieve and hash module status counts.
|
# Retrieve and hash module status counts.
|
||||||
my @rows = get_db_rows ($dbh, 'SELECT estado, COUNT(*) AS total FROM tagente_modulo, tagente_estado WHERE tagente_modulo.disabled=0 AND tagente_modulo.id_agente_modulo=tagente_estado.id_agente_modulo AND tagente_modulo.id_agente=?GROUP BY estado', $agent_id);
|
my @rows = get_db_rows ($dbh, 'SELECT estado, COUNT(*) AS total FROM tagente_modulo, tagente_estado WHERE tagente_modulo.id_agente_modulo=tagente_estado.id_agente_modulo AND tagente_modulo.id_agente=?GROUP BY estado', $agent_id);
|
||||||
foreach my $row (@rows) {
|
foreach my $row (@rows) {
|
||||||
$counts->{$row->{'estado'}} = $row->{'total'};
|
$counts->{$row->{'estado'}} = $row->{'total'};
|
||||||
$total += $row->{'total'};
|
$total += $row->{'total'};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user