Module: check_mk
Branch: master
Commit: 91bd7f010c59d20ab37758219737b0e4a50e0cdf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=91bd7f010c59d2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 21 08:56:09 2015 +0200
#2255 FIX checkpoint_*: Fixed exception in scan function when sysDescr has less than 2
spaces
When running the service discovery on SNMP devices which have a sysDescr which conains
less than 2 spaces this lead into an exception. The error was present in 1.2.6 and
master branch but only showed up in the master branch, since the error handling in
the master branch has changed to be more verbose about such problems.
---
.werks/2255 | 13 +++++++++++++
ChangeLog | 1 +
checks/checkpoint.include | 9 +++++----
3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/.werks/2255 b/.werks/2255
new file mode 100644
index 0000000..b78966e
--- /dev/null
+++ b/.werks/2255
@@ -0,0 +1,13 @@
+Title: checkpoint_*: Fixed exception in scan function when sysDescr has less than 2
spaces
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1432191240
+
+When running the service discovery on SNMP devices which have a sysDescr which conains
+less than 2 spaces this lead into an exception. The error was present in 1.2.6 and
+master branch but only showed up in the master branch, since the error handling in
+the master branch has changed to be more verbose about such problems.
diff --git a/ChangeLog b/ChangeLog
index 55cfb0a..fbc5677 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -376,6 +376,7 @@
* 2267 FIX: mk_db2.aix agent plugin: no longer throws an error when a db2 profile is
not set up properly...
* 2268 FIX: db2_tablespaces: no longer throws exception in checks when complete db2
instance vanishes
* 2272 FIX: mrpe: made UNKNOWN message more clear in case of an invalid state char
+ * 2255 FIX: checkpoint_*: Fixed exception in scan function when sysDescr has less
than 2 spaces...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/checkpoint.include b/checks/checkpoint.include
index 6fd1e6e..0d0940b 100644
--- a/checks/checkpoint.include
+++ b/checks/checkpoint.include
@@ -26,11 +26,12 @@
def scan_checkpoint(oid):
+ sys_descr = oid(".1.3.6.1.2.1.1.1.0")
return (
# Entry in sysDescr, varies a bit
- oid(".1.3.6.1.2.1.1.1.0").split("
")[2].endswith("cp") or
- oid(".1.3.6.1.2.1.1.1.0").startswith("IPSO ") or
- (oid(".1.3.6.1.2.1.1.1.0").startswith("Linux") and
"cpx" in
- oid(".1.3.6.1.2.1.1.1.0"))) \
+ (len(sys_descr) >= 3 and sys_descr.split("
")[2].endswith("cp")) or
+ sys_descr.startswith("IPSO ") or
+ (sys_descr.startswith("Linux") and "cpx" in
+ sys_descr)) \
and \
oid(".1.3.6.1.4.1.2620.1.1.21.0").lower().startswith('firewall')