Module: check_mk
Branch: master
Commit: 941d0409a4f09bc4e9992006c5c1c99b6221e6ef
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=941d0409a4f09b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jun 27 09:30:16 2012 +0200
printer_supply: Fix problem on DELL printers with "S/N" in output
---
ChangeLog | 2 ++
checks/printer_supply | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5f2eb05..90a4c31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,8 @@
for explicitely listing SIDs to monitor
* mk_logwatch on Linux: new options regex and iregex for file selection
* remove obsolete ORACLE checks where no agent plugins where available
+ * printer_supply: Fix problem on DELL printers with "S/N" in output
+ (thanks to Sebastian Talmon)
Multisite:
* Show number of rows and number of selected rows in header line
diff --git a/checks/printer_supply b/checks/printer_supply
index 974d4e9..cb73800 100644
--- a/checks/printer_supply
+++ b/checks/printer_supply
@@ -59,6 +59,8 @@ printer_supply_some_remaining_status = 1
# Workaround for toners and drum units in c5900 devices
# which have equal names for the single parts.
# Add the color description to that item
+# Fix name for toners in DELL devices that have serial
+# numbers in item name
def printer_supply_fix_infos(info):
colors = []
new_info = []
@@ -72,6 +74,8 @@ def printer_supply_fix_infos(info):
elif line[3] == '':
color = colors[index - len(colors)]
line_0 = '%s %s' % (color.title(), line_0)
+ if " S/N:" in line_0:
+ line_0 = line_0[:line_0.find(" S/N:")]
new_info.append([line_0] + line[1:])
return new_info