mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Allow notification to resume count/delay cycles after maintenance
This commit is contained in:
@@ -163,9 +163,9 @@ function RunAlerts() {
|
||||
$updet = false;
|
||||
$noacc = false;
|
||||
}
|
||||
if( IsMaintenance($device) > 0 ) {
|
||||
if( IsMaintenance($alert['device_id']) > 0 ) {
|
||||
$noiss = true;
|
||||
$noacc = false;
|
||||
$noacc = true;
|
||||
}
|
||||
if( $updet ) {
|
||||
dbUpdate(array('details' => gzcompress(json_encode($alert['details']),9)),'alert_log','id = ?',array($alert['id']));
|
||||
|
@@ -74,7 +74,7 @@ function GetRules($device) {
|
||||
/**
|
||||
* Check if device is under maintenance
|
||||
* @param int $device Device-ID
|
||||
* @return bool
|
||||
* @return int
|
||||
*/
|
||||
function IsMaintenance( $device ) {
|
||||
$groups = GetGroupsFromDevice($device);
|
||||
@@ -84,7 +84,7 @@ function IsMaintenance( $device ) {
|
||||
$where .= " || alert_schedule_items.target = ?";
|
||||
$params[] = 'g'.$group;
|
||||
}
|
||||
return dbFetchCell('SELECT DISTINCT(alert_schedule.schedule_id) FROM alert_schedule LEFT JOIN alert_schedule_items ON alert_schedule.schedule_id=alert_schedule_items.schedule_id WHERE alert_schedule_items.target = ?'.$where.' LIMIT 1',$params);
|
||||
return dbFetchCell('SELECT DISTINCT(alert_schedule.schedule_id) FROM alert_schedule LEFT JOIN alert_schedule_items ON alert_schedule.schedule_id=alert_schedule_items.schedule_id WHERE ( alert_schedule_items.target = ?'.$where.' ) && NOW() BETWEEN alert_schedule.start AND alert_schedule.end LIMIT 1',$params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user