mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
allow disable counters on mc environments
This commit is contained in:
parent
773071946f
commit
8a221f10b0
@ -530,6 +530,20 @@ class TreeService extends Tree
|
||||
$tmp['elementDescription'] = $item->description();
|
||||
$tmp['disabled'] = $item->service()->disabled();
|
||||
|
||||
$counters = [
|
||||
'total_modules' => 0,
|
||||
'total_agents' => 0,
|
||||
'total_services' => 0,
|
||||
'total_dynamic' => 0,
|
||||
'total' => 0,
|
||||
];
|
||||
|
||||
if (is_metaconsole() === false
|
||||
|| (isset($config['realtimestats']) === true
|
||||
&& $config['realtimestats'] === true
|
||||
&& $tmp['metaID'] > 0)
|
||||
) {
|
||||
// Look for counters.
|
||||
if ($this->connectedToNode === false
|
||||
&& is_metaconsole() === true
|
||||
&& $tmp['metaID'] > 0
|
||||
@ -557,14 +571,6 @@ class TreeService extends Tree
|
||||
\enterprise_hook('metaconsole_restore_db');
|
||||
}
|
||||
|
||||
$counters = [
|
||||
'total_modules' => 0,
|
||||
'total_agents' => 0,
|
||||
'total_services' => 0,
|
||||
'total_dynamic' => 0,
|
||||
'total' => 0,
|
||||
];
|
||||
|
||||
if (is_array($grandchildren) === true) {
|
||||
$counters = array_reduce(
|
||||
$grandchildren,
|
||||
@ -590,6 +596,10 @@ class TreeService extends Tree
|
||||
if ($counters['total'] > 0) {
|
||||
$tmp['searchChildren'] = 1;
|
||||
}
|
||||
} else {
|
||||
// Always search for.
|
||||
$tmp['searchChildren'] = 1;
|
||||
}
|
||||
|
||||
$tmp['type'] = 'services';
|
||||
$tmp['rootType'] = 'services';
|
||||
|
@ -2060,6 +2060,10 @@ function config_process_config()
|
||||
config_update_value('metaconsole_events_history', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['realtimestats'])) {
|
||||
config_update_value('realtimestats', 1);
|
||||
}
|
||||
|
||||
if (!isset($config['trap_purge'])) {
|
||||
config_update_value('trap_purge', 7);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user