Module: check_mk
Branch: master
Commit: 71c51fc41a0cf7fcea2d40765460dac514d376fd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=71c51fc41a0cf7…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Mar 27 14:55:36 2017 +0200
8628 FIX printer_alerts: Fix discovery when there are no alerts
Previously, the discovery would only work, when the device listed
some alerts, but not in the (hopefully more common) case that the
list of alerts was empty. This has been fixed.
Change-Id: I5639f4bac49a391844831979c3fa609c6c85801a
---
.werks/8628 | 13 +++++++++++++
checks/printer_alerts | 4 ++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/8628 b/.werks/8628
new file mode 100644
index 0000000..7f24dde
--- /dev/null
+++ b/.werks/8628
@@ -0,0 +1,13 @@
+Title: printer_alerts: Fix discovery when there are no alerts
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1490619155
+
+Previously, the discovery would only work, when the device listed
+some alerts, but not in the (hopefully more common) case that the
+list of alerts was empty. This has been fixed.
diff --git a/checks/printer_alerts b/checks/printer_alerts
index 5a33357..c1041f9 100644
--- a/checks/printer_alerts
+++ b/checks/printer_alerts
@@ -244,6 +244,6 @@ check_info["printer_alerts"] = {
'7', # prtAlertCode
'8', # prtAlertDescription
]),
- 'snmp_scan_function': \
- lambda oid: oid(".1.3.6.1.2.1.43.11.1.1.6.1.1") != None,
+ 'handle_empty_info': True,
+ 'snmp_scan_function': lambda oid:
oid(".1.3.6.1.2.1.43.11.1.1.6.1.1") != None,
}