fix toggling log in linux agent

This commit is contained in:
alejandro.campos@artica.es 2024-02-08 10:22:20 +01:00
parent 4912a4051f
commit bf4786e8fb
2 changed files with 17 additions and 1 deletions

View File

@ -674,6 +674,19 @@ if (enterprise_installed()) {
}
}
if ($id_os === '1') {
$modules = $agent_plugin->getModules();
foreach ($modules as $key => $row) {
if (preg_match('/Syslog/', $row['raw']) === 1) {
if ($row['disabled'] === 1) {
$enable_log_collector = 0;
} else {
$enable_log_collector = 1;
}
}
}
}
if ($id_os === '9') {
$modules = $agent_plugin->getModules();
foreach ($modules as $key => $row) {

View File

@ -1299,8 +1299,11 @@ if ($update_agent) {
}
$modules = $agent->getModules();
foreach ($modules as $key => $row) {
if (preg_match('/PandoraAgent_log/', $row['raw']) === 1) {
if (preg_match('/PandoraAgent_log/', $row['raw']) === 1
|| ($id_os === 1 && preg_match('/Syslog/', $row['raw']) === 1)
) {
if ($enable_log_collector === 1) {
if ($row['disabled'] === 1) {
$agent->enableModule($row['module_name'], $row);