Module: check_mk
Branch: master
Commit: 4f02f3c0e81be7bb9da47d81e014e88792c84cb5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4f02f3c0e81be7…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Fri May 18 08:57:43 2018 +0200
6110 FIX inv_if: Don't return Unknown if no data for OID 1.3.6.1.2.1.2.1.0 is present
Previously, the scan function raised a TypeError if no data was delivered for
OID 1.3.6.1.2.1.2.1.0 which resulted in an UNKNOWN status of the HW/SW
Inventory service. Now, a missing value indicates that the inventory function
should not be executed.
Change-Id: I04224ffdf9aca5bfe917168e86c5c69c4111c1a1
---
.werks/6110 | 13 +++++++++++++
inventory/if | 2 ++
2 files changed, 15 insertions(+)
diff --git a/.werks/6110 b/.werks/6110
new file mode 100644
index 0000000..84c9596
--- /dev/null
+++ b/.werks/6110
@@ -0,0 +1,13 @@
+Title: inv_if: Don't return Unknown if no data for OID 1.3.6.1.2.1.2.1.0 is present
+Level: 1
+Component: inv
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1526625999
+Class: fix
+
+Previously, the scan function raised a TypeError if no data was delivered for
+OID 1.3.6.1.2.1.2.1.0 which resulted in an UNKNOWN status of the HW/SW
+Inventory service. Now, a missing value indicates that the inventory function
+should not be executed.
diff --git a/inventory/if b/inventory/if
index 4bef0ed..f58cef8 100644
--- a/inventory/if
+++ b/inventory/if
@@ -30,6 +30,8 @@ def scan_inv_if(oid):
return int(oid(".1.3.6.1.2.1.2.1.0")) >= 2
except ValueError:
return False
+ except TypeError:
+ return False
# TODO unify with other if inventory plugins