Module: check_mk
Branch: master
Commit: de3137f19219ac314b1a501eff64c741e472e92e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=de3137f19219ac…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Aug 20 11:17:54 2015 +0200
#1282 FIX win_printers: Not longer discover offline printers
---
.werks/1282 | 9 +++++++++
ChangeLog | 1 +
checks/win_printers | 11 ++++++++---
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/.werks/1282 b/.werks/1282
new file mode 100644
index 0000000..6d3496d
--- /dev/null
+++ b/.werks/1282
@@ -0,0 +1,9 @@
+Title: win_printers: Not longer discover offline printers
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1440062250
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index bab6d11..82ca1ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -123,6 +123,7 @@
* 2492 FIX: check_mk_agent.linux: avoid problems with crashing waitmax after Ubuntu
update...
* 2507 FIX: mysql_slave: fixed exception caused by wrong parsing of agent data
* 1280 FIX: check_mail_loop: It was not possible to use POP3 as protocol to fetch
mails
+ * 1282 FIX: win_printers: Not longer discover offline printers
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/win_printers b/checks/win_printers
index 7537ad6..80000f1 100644
--- a/checks/win_printers
+++ b/checks/win_printers
@@ -26,10 +26,15 @@
# Example output from agent:
# Put here the example output from your TCP-Based agent. If the
-# check is SNMP-Based, then remove this section
+# <<<win_printers>>>
+# PrinterStockholm 0 3 0
+# WH1_BC_O3_UPS 0 3 0
+
def inventory_win_printers(info):
- return [ (" ".join(x[:-3]), None) for x in info ]
+ for line in info:
+ if line[-1] != '9': # Do not discovery offline printers
+ yield " ".join(line[:-3]), None
def check_win_printers(item, params, info):
status_map = {
@@ -65,7 +70,7 @@ def check_win_printers(item, params, info):
name = " ".join(line[:-3])
if name == item:
state = 0
- current_jobs, status, error = map(saveint, line[-3:])
+ current_jobs, status, error = map(int, line[-3:])
error_text = ""
if error in [ 9, 10 ]: