mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add alert rule option to invert devices and groups "map to" list (#11038)
* Add alert rule option to invert map to * Update 2019_12_17_151314_add_invert_map_to_alert_rules.php * fix invert map to does not work if several groups are set in map to * Clarify labels * fix invert map to at rule creation * clarify invert label * Fix device in map to - not group * dummy commit
This commit is contained in:
@@ -58,6 +58,7 @@ $invert = mres(isset($_POST['invert']) ? $_POST['invert'] : null);
|
||||
$name = mres($_POST['name']);
|
||||
$proc = mres($_POST['proc']);
|
||||
$recovery = ($vars['recovery']);
|
||||
$invert_map = mres(isset($_POST['invert_map']) ? $_POST['invert_map'] : null);
|
||||
$severity = mres($_POST['severity']);
|
||||
|
||||
if (!is_numeric($count)) {
|
||||
@@ -81,6 +82,12 @@ if ($invert == 'on') {
|
||||
|
||||
$recovery = empty($recovery) ? $recovery = false : true;
|
||||
|
||||
if ($invert_map == 'on') {
|
||||
$invert_map = true;
|
||||
} else {
|
||||
$invert_map = false;
|
||||
}
|
||||
|
||||
$extra = array(
|
||||
'mute' => $mute,
|
||||
'count' => $count,
|
||||
@@ -101,7 +108,8 @@ if (is_numeric($rule_id) && $rule_id > 0) {
|
||||
'name' => $name,
|
||||
'proc' => $proc,
|
||||
'query' => $query,
|
||||
'builder' => $builder_json
|
||||
'builder' => $builder_json,
|
||||
'invert_map' => $invert_map
|
||||
),
|
||||
'alert_rules',
|
||||
'id=?',
|
||||
@@ -128,7 +136,8 @@ if (is_numeric($rule_id) && $rule_id > 0) {
|
||||
'name' => $name,
|
||||
'proc' => $proc,
|
||||
'query' => $query,
|
||||
'builder' => $builder_json
|
||||
'builder' => $builder_json,
|
||||
'invert_map' => $invert_map
|
||||
), 'alert_rules');
|
||||
|
||||
if ($rule_id) {
|
||||
|
||||
@@ -77,5 +77,6 @@ if (is_array($rule)) {
|
||||
'builder' => $builder,
|
||||
'severity' => $rule['severity'],
|
||||
'adv_query' => $rule['query'],
|
||||
'invert_map' => $rule['invert_map'],
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user