Module: check_mk
Branch: master
Commit: 15c277a2dff282a205cbf0ece432645408feaf71
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=15c277a2dff282…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 14 11:42:51 2015 +0200
#2460 FIX Slightly more robust SNMP trap translation
SNMP traps having specific OIDs, like e.g. just ".1.3.6.1" were causing
an exception when the Event Console tried to parse them. This has been
changed to be more robust now.
---
.werks/2460 | 11 +++++++++++
ChangeLog | 1 +
mkeventd/bin/mkeventd | 5 ++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/2460 b/.werks/2460
new file mode 100644
index 0000000..9653a91
--- /dev/null
+++ b/.werks/2460
@@ -0,0 +1,11 @@
+Title: Slightly more robust SNMP trap translation
+Level: 1
+Component: ec
+Compatible: compat
+Version: 1.2.7i3
+Date: 1436866882
+Class: fix
+
+SNMP traps having specific OIDs, like e.g. just ".1.3.6.1" were causing
+an exception when the Event Console tried to parse them. This has been
+changed to be more robust now.
diff --git a/ChangeLog b/ChangeLog
index a5f96c3..fa6ab99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -91,6 +91,7 @@
Event Console:
* 2322 FIX: mkeventd: MIBs are now only loaded if SNMP Traps translation is
activated...
+ * 2460 FIX: Slightly more robust SNMP trap translation...
HW/SW-Inventory:
* 2128 mk_inventory.vbs: inventory plugin for Windows now available as vbs script...
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index 6812da7..6ac5cc7 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -1224,7 +1224,10 @@ class EventServer:
mod, sym, indices = mib_var.getMibSymbol()
# Only care about the first indice reported. Why should we care about
multiple?
# Do we have such cases here?
- translated_oid = '%s::%s.%s' % (mod, sym,
indices[0].prettyPrint())
+ if not indices:
+ translated_oid = '%s::%s' % (mod, sym)
+ else:
+ translated_oid = '%s::%s.%s' % (mod, sym,
indices[0].prettyPrint())
# This MACRO supports SYNTAX clause?
if hasattr(node, 'getSyntax'):