Merge branch 'ent-12851-Se-ha-roto-el-token-Enable-log-collection-de-agente-software-linux-desde-la-consola' into 'develop'
fix toggling log in linux agent See merge request artica/pandorafms!6923
This commit is contained in:
commit
8422aba9d7
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue