Module: check_mk
Branch: master
Commit: abd8a81ec4166219bb7c900a54cafa384cbde0fa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=abd8a81ec41662…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed May 4 16:49:46 2016 +0200
3566 FIX Fixed exception on SNMP MIB management page when MIB directory is missing
---
.werks/3566 | 10 ++++++++++
ChangeLog | 1 +
web/plugins/wato/mkeventd.py | 10 +++++++++-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/3566 b/.werks/3566
new file mode 100644
index 0000000..2a986da
--- /dev/null
+++ b/.werks/3566
@@ -0,0 +1,10 @@
+Title: Fixed exception on SNMP MIB management page when MIB directory is missing
+Level: 1
+Component: ec
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1462373346
+
+
diff --git a/ChangeLog b/ChangeLog
index 9b49ac1..e933f4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -394,6 +394,7 @@
* 3350 FIX: Merged source of Event Console with Check_MK...
* 3240 FIX: Fixed various quotation issues in GUI parts related to the EC
* 3026 FIX: Event console: The "Add comment" option of a rule is now able
to add the original text (\0)
+ * 3566 FIX: Fixed exception on SNMP MIB management page when MIB directory is
missing
Livestatus:
* 3233 FIX: Fixed shutdown of Nagios core with Livestatus module...
diff --git a/web/plugins/wato/mkeventd.py b/web/plugins/wato/mkeventd.py
index 6ed8890..f02329f 100644
--- a/web/plugins/wato/mkeventd.py
+++ b/web/plugins/wato/mkeventd.py
@@ -1946,7 +1946,15 @@ def delete_mib(filename, mib_name):
def load_snmp_mibs(path):
found = {}
- for fn in os.listdir(path):
+ try:
+ file_names = os.listdir(path)
+ except OSError, e:
+ if e.errno == 2: # not existing directories are ok
+ return found
+ else:
+ raise
+
+ for fn in file_names:
if fn[0] != '.':
mib = parse_snmp_mib_header(path + "/" + fn)
found[fn] = mib