Module: check_mk
Branch: master
Commit: d57154234bff2f93268e2f248d3d3b4e217218a9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d57154234bff2f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 27 14:21:45 2015 +0100
raise exception when scan functions ask for OIDs without leading "."
---
modules/check_mk.py | 3 +++
modules/discovery.py | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index e74d557..673ae20 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -739,6 +739,9 @@ def get_single_oid(hostname, ipaddress, oid):
# we do a snmpgetnext and try to find an OID with the prefix
# in question. The *cache* is working including the X, however.
+ if oid[0] != '.':
+ raise MKGeneralException("OID definition '%s' does not begin with
." % oid)
+
global g_single_oid_hostname
global g_single_oid_cache
diff --git a/modules/discovery.py b/modules/discovery.py
index 78fe93f..0315c32 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -345,6 +345,10 @@ def snmp_scan(hostname, ipaddress):
elif result:
found.append(check_type)
vverbose(" " + check_type)
+ except MKGeneralException:
+ # some error messages which we explicitly want to show to the user
+ # should be raised through this
+ raise
except:
pass
else: