Run Alert Rules on Service status change. (#13348)

* Run Alert Rules on Service status change.

Added Alert Rules to the poll_service function to trigger alerts outside of polling interval.

* Update services.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
Thomas Ford
2021-10-20 20:44:39 -05:00
committed by GitHub
parent 8d5d0b12c3
commit 0b5e826363

View File

@ -1,6 +1,7 @@
<?php
use App\Models\Device;
use LibreNMS\Alert\AlertRules;
use LibreNMS\Config;
use LibreNMS\RRD\RrdDefinition;
@ -196,6 +197,10 @@ function poll_service($service)
4,
$service['service_id']
);
// Run alert rules due to status changed
$rules = new AlertRules;
$rules->runRules($service->device_id);
}
if ($service['service_message'] != $msg) {