Merge branch 'ent-13144-2-keepalive-en-el-mismo-agente-provoca-que-1-nunca-cambie-su-estado' into 'develop'

Changes on Keep Alive

See merge request artica/pandorafms!7278
This commit is contained in:
Enrique Martin 2024-04-29 07:43:12 +00:00
commit 3139b66152
1 changed files with 5 additions and 5 deletions

View File

@ -3674,12 +3674,12 @@ Updates the keep_alive module for the given agent.
sub pandora_module_keep_alive ($$$$$) {
my ($pa_config, $id_agent, $agent_name, $server_id, $dbh) = @_;
logger($pa_config, "Updating keep_alive module for agent '" . safe_output($agent_name) . "'.", 10);
logger($pa_config, "Updating keep_alive modules for agent '" . safe_output($agent_name) . "'.", 10);
# Update keepalive module
my $module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente = ? AND delete_pending = 0 AND id_tipo_modulo = 100', $id_agent);
if (defined ($module)) {
my %data = ('data' => 1);
# Update keepalive modules
my @modules = get_db_rows($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente = ? AND delete_pending = 0 AND id_tipo_modulo = 100', $id_agent);
my %data = ('data' => 1);
foreach my $module (@modules) {
pandora_process_module ($pa_config, \%data, '', $module, 'keep_alive', '', time(), $server_id, $dbh);
}
}