10092-Widget tree view, Not normal status
This commit is contained in:
parent
57dd29063c
commit
feb2f3ffa2
|
@ -214,6 +214,11 @@ class Tree
|
||||||
AND ta.unknown_count = 0
|
AND ta.unknown_count = 0
|
||||||
AND ta.normal_count > 0) ';
|
AND ta.normal_count > 0) ';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case AGENT_STATUS_NOT_NORMAL:
|
||||||
|
$agent_status_filter = ' AND (ta.critical_count > 0
|
||||||
|
OR ta.warning_count > 0) ';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $agent_status_filter;
|
return $agent_status_filter;
|
||||||
|
@ -285,6 +290,10 @@ class Tree
|
||||||
return $show_init_condition;
|
return $show_init_condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((int) $this->filter['statusModule'] === 6) {
|
||||||
|
return ' AND (ta.warning_count > 0 OR ta.critical_count > 0)';
|
||||||
|
}
|
||||||
|
|
||||||
$field_filter = modules_get_counter_by_states($this->filter['statusModule']);
|
$field_filter = modules_get_counter_by_states($this->filter['statusModule']);
|
||||||
if ($field_filter === false) {
|
if ($field_filter === false) {
|
||||||
return ' AND 1=0';
|
return ' AND 1=0';
|
||||||
|
@ -894,6 +903,18 @@ class Tree
|
||||||
$agent['counters']['ok'] = $agent['normal_count'];
|
$agent['counters']['ok'] = $agent['normal_count'];
|
||||||
$agent['counters']['total'] = $agent['normal_count'];
|
$agent['counters']['total'] = $agent['normal_count'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case AGENT_MODULE_STATUS_NOT_NORMAL:
|
||||||
|
if (empty($agent['critical_count']) === false) {
|
||||||
|
$agent['counters']['critical'] = $agent['critical_count'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($agent['warning_count']) === false) {
|
||||||
|
$agent['counters']['warning'] = $agent['warning_count'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$agent['counters']['total'] = ($agent['warning_count'] + $agent['critical_count']);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -956,6 +956,11 @@ function processTreeSearch(settings) {
|
||||||
agents: settings.translate.ok.agents,
|
agents: settings.translate.ok.agents,
|
||||||
modules: settings.translate.ok.modules,
|
modules: settings.translate.ok.modules,
|
||||||
none: settings.translate.ok.none
|
none: settings.translate.ok.none
|
||||||
|
},
|
||||||
|
not_normal: {
|
||||||
|
agents: settings.translate.not_normal.agents,
|
||||||
|
modules: settings.translate.not_normal.modules,
|
||||||
|
none: settings.translate.not_normal.none
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -243,6 +243,10 @@ class TreeViewWidget extends Widget
|
||||||
$values['agentStatus'] = AGENT_STATUS_NOT_INIT;
|
$values['agentStatus'] = AGENT_STATUS_NOT_INIT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
$values['agentStatus'] = AGENT_STATUS_NOT_NORMAL;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
case -1:
|
case -1:
|
||||||
$values['agentStatus'] = AGENT_STATUS_ALL;
|
$values['agentStatus'] = AGENT_STATUS_ALL;
|
||||||
|
@ -284,6 +288,10 @@ class TreeViewWidget extends Widget
|
||||||
$values['moduleStatus'] = AGENT_MODULE_STATUS_NOT_INIT;
|
$values['moduleStatus'] = AGENT_MODULE_STATUS_NOT_INIT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
$values['moduleStatus'] = AGENT_MODULE_STATUS_NOT_NORMAL;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
case -1:
|
case -1:
|
||||||
$values['moduleStatus'] = -1;
|
$values['moduleStatus'] = -1;
|
||||||
|
@ -387,6 +395,7 @@ class TreeViewWidget extends Widget
|
||||||
AGENT_STATUS_CRITICAL => __('Critical'),
|
AGENT_STATUS_CRITICAL => __('Critical'),
|
||||||
AGENT_STATUS_UNKNOWN => __('Unknown'),
|
AGENT_STATUS_UNKNOWN => __('Unknown'),
|
||||||
AGENT_STATUS_NOT_INIT => __('Not init'),
|
AGENT_STATUS_NOT_INIT => __('Not init'),
|
||||||
|
AGENT_STATUS_NOT_NORMAL => __('Not normal'),
|
||||||
];
|
];
|
||||||
|
|
||||||
$inputs[] = [
|
$inputs[] = [
|
||||||
|
@ -420,6 +429,7 @@ class TreeViewWidget extends Widget
|
||||||
AGENT_MODULE_STATUS_CRITICAL_BAD => __('Critical'),
|
AGENT_MODULE_STATUS_CRITICAL_BAD => __('Critical'),
|
||||||
AGENT_MODULE_STATUS_UNKNOWN => __('Unknown'),
|
AGENT_MODULE_STATUS_UNKNOWN => __('Unknown'),
|
||||||
AGENT_MODULE_STATUS_NOT_INIT => __('Not init'),
|
AGENT_MODULE_STATUS_NOT_INIT => __('Not init'),
|
||||||
|
AGENT_MODULE_STATUS_NOT_NORMAL => __('Not normal'),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (is_metaconsole() === false) {
|
if (is_metaconsole() === false) {
|
||||||
|
@ -682,6 +692,11 @@ class TreeViewWidget extends Widget
|
||||||
'modules' => __('Normal modules'),
|
'modules' => __('Normal modules'),
|
||||||
'none' => __('Normal'),
|
'none' => __('Normal'),
|
||||||
],
|
],
|
||||||
|
'not_normal' => [
|
||||||
|
'agents' => __('Not normal agents'),
|
||||||
|
'modules' => __('Not normal modules'),
|
||||||
|
'none' => __('Not normal'),
|
||||||
|
],
|
||||||
'module' => __('Module'),
|
'module' => __('Module'),
|
||||||
'timeOnlyTitle' => __('Choose time'),
|
'timeOnlyTitle' => __('Choose time'),
|
||||||
'timeText' => __('Time'),
|
'timeText' => __('Time'),
|
||||||
|
|
|
@ -484,7 +484,12 @@ enterprise_hook('close_meta_frame');
|
||||||
agents: "<?php echo __('Normal agents'); ?>",
|
agents: "<?php echo __('Normal agents'); ?>",
|
||||||
modules: "<?php echo __('Normal modules'); ?>",
|
modules: "<?php echo __('Normal modules'); ?>",
|
||||||
none: "<?php echo __('Normal'); ?>"
|
none: "<?php echo __('Normal'); ?>"
|
||||||
}
|
},
|
||||||
|
not_normal: {
|
||||||
|
agents: "<?php echo __('Not normal agents'); ?>",
|
||||||
|
modules: "<?php echo __('Not normal modules'); ?>",
|
||||||
|
none: "<?php echo __('Not normal'); ?>"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue