Merge branch 'ent-4094-Error-al-cambiar-intervalo-de-agentes-por-masivas' into 'develop'
fixed bug: agent interval not being changed in agent config when changing its… See merge request artica/pandorafms!2601
This commit is contained in:
commit
8c55c1b287
|
@ -170,6 +170,8 @@ if ($update_agents) {
|
|||
$n_edited = 0;
|
||||
$result = false;
|
||||
foreach ($id_agents as $id_agent) {
|
||||
$old_interval_value = db_get_value_filter('intervalo', 'tagente', ['id_agente' => $id_agent]);
|
||||
|
||||
if (!empty($values)) {
|
||||
$group_old = false;
|
||||
$disabled_old = false;
|
||||
|
@ -196,6 +198,18 @@ if ($update_agents) {
|
|||
$result_metaconsole = agent_update_from_cache($id_agent, $values, $server_name);
|
||||
}
|
||||
|
||||
// Update the configuration files.
|
||||
if ($result && ($old_interval_value != $values['intervalo'])) {
|
||||
enterprise_hook(
|
||||
'config_agents_update_config_token',
|
||||
[
|
||||
$id_agent,
|
||||
'interval',
|
||||
$values['intervalo'],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if ($disabled_old !== false && $disabled_old != $values['disabled']) {
|
||||
enterprise_hook(
|
||||
'config_agents_update_config_token',
|
||||
|
|
Loading…
Reference in New Issue