Module: check_mk
Branch: master
Commit: 5487329ba22700fd5c2a478d68be5336051d0bce
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5487329ba22700…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 15 09:14:37 2016 +0200
EC: The SNMP engine ID is now optional for SNMP credentials
---
bin/mkeventd | 9 +++++----
web/plugins/wato/mkeventd.py | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/bin/mkeventd b/bin/mkeventd
index a9662c4..e541678 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -26,6 +26,7 @@
import socket, os, time, sys, getopt, signal, thread, pprint, re, \
select, subprocess, stat, string
+import traceback
from cmk.regex import regex, is_regex
import cmk.daemon
@@ -355,7 +356,7 @@ def replace_groups(text, origtext, groups):
def format_exception():
- import StringIO, traceback
+ import StringIO
txt = StringIO.StringIO()
t, v, tb = sys.exc_info()
traceback.print_exception(t, v, tb, None, txt)
@@ -375,7 +376,7 @@ class VerboseLock:
log("LOCK %s: %d -> %d" % (self._name, self._depth-1,
self._depth))
return self
- def __exit__(self, type, value, traceback):
+ def __exit__(self, type, value, tb):
self._depth -= 1
if opt_debug:
log("LOCK %s: %d -> %d" % (self._name, self._depth+1,
self._depth))
@@ -463,7 +464,7 @@ def initialize_snmp_credentials():
# SNMPv1/v2
if type(credentials) != tuple:
- snmp_config.addV1System(g_snmp_engine, 'snmpv2-' % user_num,
credentials)
+ snmp_config.addV1System(g_snmp_engine, 'snmpv2-%d' % user_num,
credentials)
continue
# SNMPv3
@@ -4242,4 +4243,4 @@ try:
except Exception, e:
if opt_debug:
raise
- bail_out(e)
+ bail_out(traceback.format_exc())
diff --git a/web/plugins/wato/mkeventd.py b/web/plugins/wato/mkeventd.py
index ab666d8..0f77a74 100644
--- a/web/plugins/wato/mkeventd.py
+++ b/web/plugins/wato/mkeventd.py
@@ -2592,7 +2592,7 @@ if mkeventd_enabled:
allow_empty = False,
)),
],
- optional_keys = [],
+ optional_keys = ["engine_ids"],
),
title = _("Credentials for processing SNMP traps"),
help = _("When you want to process SNMP traps with the Event Console it
is "