fix toggling log in linux agent
This commit is contained in:
parent
4912a4051f
commit
bf4786e8fb
|
@ -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