Module: check_mk
Branch: master
Commit: 3223e5a4a51e5ead02c1e029b9b4302a2a63b601
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3223e5a4a51e5e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jan 30 16:08:00 2015 +0100
#1971 FIX printer_input/printer_output: Discovery is using name field when available no
The service discovery of the printer_input/printer_output checks were always using
the index of the unit instead of the name. We have fixed this now.
You don't have to take an immediate action, because already discovered checks will
continue working. But your "Check_MK Discovery" service will report new
services
and when you do a re-discovery, the new services will be found.
---
.werks/1971 | 15 +++++++++++++++
ChangeLog | 2 ++
checks/printer_io.include | 6 ++----
3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/.werks/1971 b/.werks/1971
new file mode 100644
index 0000000..a4e2107
--- /dev/null
+++ b/.werks/1971
@@ -0,0 +1,15 @@
+Title: printer_input/printer_output: Discovery is using name field when available no
+Level: 1
+Component: checks
+Class: fix
+Compatible: incomp
+State: unknown
+Version: 1.2.7i1
+Date: 1422630051
+
+The service discovery of the printer_input/printer_output checks were always using
+the index of the unit instead of the name. We have fixed this now.
+
+You don't have to take an immediate action, because already discovered checks will
+continue working. But your "Check_MK Discovery" service will report new
services
+and when you do a re-discovery, the new services will be found.
diff --git a/ChangeLog b/ChangeLog
index 6d1e1ce..6cce05e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -131,6 +131,8 @@
* 1969 FIX: apc_symmetra: Fix wrong critical state "0 batteries need
replacement"
* 1926 FIX: ps: reenable compatiblity with existing configurations...
* 1970 FIX: lparstat_aix: Made the check compatible to different kind of lparstat
output...
+ * 1971 FIX: printer_input/printer_output: Discovery is using name field when
available no...
+ NOTE: Please refer to the migration notes!
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/printer_io.include b/checks/printer_io.include
index 15ec0d1..f52dbf3 100644
--- a/checks/printer_io.include
+++ b/checks/printer_io.include
@@ -83,10 +83,8 @@ def inventory_printer_io(info):
# When no name is set
# a) try to use the description
# b) try to use the type otherwise use the index
- if not name and descr:
- name = descr
- else:
- name = index.split('.')[-1]
+ if not name:
+ name = descr and descr or index.split('.')[-1]
yield (name, {})