mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix Fast Ping alerts always running (#12510)
Alerts should only be ran if the status changes. This should restore some speed. Was broken by another fix.
This commit is contained in:
@ -256,9 +256,11 @@ class PingCheck implements ShouldQueue
|
|||||||
|
|
||||||
$device->save(); // only saves if needed (which is every time because of last_ping)
|
$device->save(); // only saves if needed (which is every time because of last_ping)
|
||||||
|
|
||||||
|
if (isset($type)) { // only run alert rules if status changed
|
||||||
echo "Device $device->hostname changed status to $type, running alerts\n";
|
echo "Device $device->hostname changed status to $type, running alerts\n";
|
||||||
$rules = new AlertRules;
|
$rules = new AlertRules;
|
||||||
$rules->runRules($device->device_id);
|
$rules->runRules($device->device_id);
|
||||||
|
}
|
||||||
|
|
||||||
// add data to rrd
|
// add data to rrd
|
||||||
app('Datastore')->put($device->toArray(), 'ping-perf', $this->rrd_tags, ['ping' => $device->last_ping_timetaken]);
|
app('Datastore')->put($device->toArray(), 'ping-perf', $this->rrd_tags, ['ping' => $device->last_ping_timetaken]);
|
||||||
|
Reference in New Issue
Block a user