Skip to content

Commit f5061a8

Browse files
authored
SNMP Traps: run alert rules only when necessary (librenms#18416)
* Refactor alertrule condition in Dispatcher.php * StyleCI * Simplified logic * Nvm. Original logic was correct. * NVM to my NVM. lol.
1 parent b89c74e commit f5061a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

LibreNMS/Snmptrap/Dispatcher.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public static function handle(Trap $trap): bool
6565
$detailed = LibrenmsConfig::get('snmptraps.eventlog_detailed', false);
6666
if ($logging == 'all' || ($fallback && $logging == 'unhandled')) {
6767
$trap->log($trap->toString($detailed));
68-
} else {
68+
}
69+
if ($logging != 'none' || ! $fallback) {
6970
$rules = new AlertRules;
7071
$rules->runRules($trap->getDevice()->device_id);
7172
}

0 commit comments

Comments
 (0)