mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
webui: Allow user to display ok/warning/critical alerts only (#7484)
* Allow user to display ok/warning/critical alerts only * Update alerts.inc.php * Update alerts.inc.php
This commit is contained in:
committed by
Neil Lathwood
parent
2f2234da70
commit
62867a6661
@@ -10,14 +10,17 @@ $alert_states = array(
|
||||
'alerted' => 1,
|
||||
'acknowledged' => 2,
|
||||
'worse' => 3,
|
||||
'better' => 4
|
||||
'better' => 4,
|
||||
);
|
||||
|
||||
$alert_severities = array(
|
||||
// alert_rules.status is enum('ok','warning','critical')
|
||||
'ok' => 1,
|
||||
'warning' => 2,
|
||||
'critical' => 3
|
||||
'critical' => 3,
|
||||
'ok only' => 4,
|
||||
'warning only' => 5,
|
||||
'critical only' => 6,
|
||||
);
|
||||
|
||||
$show_recovered = false;
|
||||
@@ -45,7 +48,7 @@ if (isset($_POST['min_severity'])) {
|
||||
$min_severity_id = $alert_severities[$_POST['min_severity']];
|
||||
}
|
||||
if (isset($min_severity_id)) {
|
||||
$where .= " AND `alert_rules`.`severity` >= ".$min_severity_id;
|
||||
$where .= " AND `alert_rules`.`severity` ".($min_severity_id > 3 ? "" :">")."= ".($min_severity_id > 3 ? $min_severity_id - 3 : $min_severity_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user