mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user