"Disable alerting" on device disables alert rules check (not just alert transport) (#11015)

* Fix disable notify

* Fix disable notify

* Disable all alerting

* fix db migration

* fix db migration

* fix db migration

* Add autoclearing active alerts if disable alerting set

* Add autoclearing active alerts if disable alerting set

* fix check

* Device in gray if disable_notify is set - not ignore tag
This commit is contained in:
louis-oui
2020-01-10 01:46:52 +01:00
committed by Kevin Krumm
parent f40f4e1864
commit 0e3c472018
7 changed files with 66 additions and 22 deletions

View File

@@ -44,7 +44,16 @@ class AlertRules
//Check to see if under maintenance
if (AlertUtil::isMaintenance($device_id) > 0) {
echo "Under Maintenance, Skipping alerts.\r\n";
echo "Under Maintenance, skipping alert rules check.\r\n";
return false;
}
//Check to see if disable alerting is set
if (AlertUtil::hasDisableNotify($device_id)) {
echo "Disable alerting is set, Clearing active alerts and skipping alert rules check\r\n";
$device_alert['state'] = 0;
$device_alert['alerted'] = 0;
$device_alert['open'] = 0;
dbUpdate($device_alert, 'alerts', '`device_id` = ?', array($device_id));
return false;
}
//Checks each rule.