Module: check_mk
Branch: master
Commit: 5deccba2d5127d1c755b3024dbe29e5c038057b7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5deccba2d5127d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Apr 9 08:54:13 2015 +0200
#2172 FIX Allowing OIDs in checks not starting with a dot again
Within Check_MK it is not allowed to use SNMP OIDs not starting with a ".".
The last release introduced a check which forced all users to fix the SNMP OID
declarations which don't start with a dot.
Because many users had problems with this error, e decided to make this check less
restrictive. The check accepts the missing dots now and adds it silently for
internal processing. Only in debug mode such OID definitions leads to an exception.
---
.werks/2172 | 16 ++++++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 5 ++++-
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/2172 b/.werks/2172
new file mode 100644
index 0000000..6bed646
--- /dev/null
+++ b/.werks/2172
@@ -0,0 +1,16 @@
+Title: Allowing OIDs in checks not starting with a dot again
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1428562298
+
+Within Check_MK it is not allowed to use SNMP OIDs not starting with a ".".
+The last release introduced a check which forced all users to fix the SNMP OID
+declarations which don't start with a dot.
+
+Because many users had problems with this error, e decided to make this check less
+restrictive. The check accepts the missing dots now and adds it silently for
+internal processing. Only in debug mode such OID definitions leads to an exception.
diff --git a/ChangeLog b/ChangeLog
index ddb963c..ee65b76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -312,6 +312,7 @@
* 2111 FIX: hitachi_hnas_volume: fix for cases when size information of volumes is
not available
* 2190 FIX: jolokia_metrics.gc: Fixed exception in check if no warn/crit levels are
defined
* 2192 FIX: check_notify_count": Fix exception in PNP template in case of explit
email addresses...
+ * 2172 FIX: Allowing OIDs in checks not starting with a dot again...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 2a89fc3..41ac616 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -785,7 +785,10 @@ def get_single_oid(hostname, ipaddress, oid):
# in question. The *cache* is working including the X, however.
if oid[0] != '.':
- raise MKGeneralException("OID definition '%s' does not begin with
." % oid)
+ if opt_debug:
+ raise MKGeneralException("OID definition '%s' does not begin
with a '.'" % oid)
+ else:
+ oid = '.' + oid
global g_single_oid_hostname
global g_single_oid_cache