Skip to content

Commit f5b946d

Browse files
committed
User alert id for query. continue if missing alert (should never happen)
1 parent c38392a commit f5b946d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

LibreNMS/Alert/RunAlerts.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,14 +512,14 @@ public function runAlerts()
512512
}
513513

514514
$status_check = DB::table('alerts')
515-
->where('alerts.rule_id', $alert['rule_id'])
515+
->where('alerts.id', $alert['id'])
516516
->leftJoin('devices', 'alerts.device_id', '=', 'devices.device_id')
517517
->first(['alerts.alerted', 'devices.ignore', 'devices.disabled']);
518518

519519
if ($status_check === null) {
520-
Log::error('Alert rule not found');
520+
Log::error('Alert not found');
521521

522-
return;
522+
continue;
523523
}
524524

525525
if ($status_check->alerted == $alert['state']) {

0 commit comments

Comments
 (0)