mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
Fix alert detail count missing (try2) (#16309)
This commit is contained in:
parent
c7c8f5dfc1
commit
a7aaaac103
@ -391,6 +391,11 @@ class RunAlerts
|
||||
$rextra['recovery'] = true;
|
||||
}
|
||||
|
||||
if (! isset($alert['details']['count'])) {
|
||||
// make sure count is set for below code, in legacy code null would get type juggled to 0
|
||||
$alert['details']['count'] = 0;
|
||||
}
|
||||
|
||||
$chk = dbFetchRow('SELECT alerts.alerted,devices.ignore,devices.disabled FROM alerts,devices WHERE alerts.device_id = ? && devices.device_id = alerts.device_id && alerts.rule_id = ?', [$alert['device_id'], $alert['rule_id']]);
|
||||
|
||||
if ($chk['alerted'] == $alert['state']) {
|
||||
@ -432,7 +437,7 @@ class RunAlerts
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($alert['state'], [AlertState::ACTIVE, AlertState::WORSE, AlertState::BETTER]) && ! empty($rextra['count']) && isset($alert['details']['count']) && ($rextra['count'] == -1 || $alert['details']['count']++ < $rextra['count'])) {
|
||||
if (in_array($alert['state'], [AlertState::ACTIVE, AlertState::WORSE, AlertState::BETTER]) && ! empty($rextra['count']) && ($rextra['count'] == -1 || $alert['details']['count']++ < $rextra['count'])) {
|
||||
if ($alert['details']['count'] < $rextra['count']) {
|
||||
$noacc = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user