Module: check_mk
Branch: master
Commit: 99d50348c95ba5e2ff4ccdaad0655d180358e762
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=99d50348c95ba5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon May 22 10:33:27 2017 +0200
4731 FIX Fixed exception when receiving SNMPv3 INFORM messages: ignore them now
SNMPv3 INFORM messages sent to the Event Console were already dropped, but resulted
in exceptions written to the mkeventd.log. These exceptions have now been fixed.
Change-Id: Ie9a01fd9131d9579f90fbb827a7c1c76924a4ded
---
.werks/4731 | 11 +++++++++++
bin/mkeventd | 9 ++++++---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/4731 b/.werks/4731
new file mode 100644
index 0000000..b86b9d2
--- /dev/null
+++ b/.werks/4731
@@ -0,0 +1,11 @@
+Title: Fixed exception when receiving SNMPv3 INFORM messages: ignore them now
+Level: 1
+Component: ec
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1495441913
+Class: fix
+
+SNMPv3 INFORM messages sent to the Event Console were already dropped, but resulted
+in exceptions written to the mkeventd.log. These exceptions have now been fixed.
diff --git a/bin/mkeventd b/bin/mkeventd
index 3051cea..a11ee13 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -481,9 +481,12 @@ def initialize_snmptrap_engine():
global g_snmp_engine, g_snmp_receiver
g_snmp_engine = snmp_engine.SnmpEngine()
+ # Disable receiving of SNMPv3 INFORM messages. We do not support them (yet)
+ class ECNotificationReceiver(snmp_ntfrcv.NotificationReceiver):
+ pduTypes = (snmp_v1.TrapPDU.tagSet, snmp_v2c.SNMPv2TrapPDU.tagSet)
+
initialize_snmp_credentials()
- g_snmp_receiver = snmp_ntfrcv.NotificationReceiver(g_snmp_engine,
- g_event_server.handle_snmptrap)
+ g_snmp_receiver = ECNotificationReceiver(g_snmp_engine,
g_event_server.handle_snmptrap)
def initialize_snmp_credentials():
@@ -4780,7 +4783,7 @@ try:
from pysnmp.entity import engine as snmp_engine
from pysnmp.entity import config as snmp_config
from pysnmp.entity.rfc3413 import ntfrcv as snmp_ntfrcv
- from pysnmp.proto.api import v2c as snmp_v2c
+ from pysnmp.proto.api import v2c as snmp_v2c, v1 as snmp_v1
from pysnmp.proto import api as pysnmp_api
from pyasn1.codec.ber import decoder as pyasn_decoder