Module: check_mk
Branch: master
Commit: 50f27a9a08dd8254c86d0f53b64335682b76f75d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=50f27a9a08dd82…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Feb 26 14:43:26 2014 +0100
FIX Fixed printer_pages
The old version used a not exsisting OID who leads to a error when using inline snmp.
---
.werks/137 | 9 +++++++++
ChangeLog | 1 +
checks/printer_pages | 27 ++++++++-------------------
3 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/.werks/137 b/.werks/137
new file mode 100644
index 0000000..a2c95e2
--- /dev/null
+++ b/.werks/137
@@ -0,0 +1,9 @@
+Title: Fixed printer_pages
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1393422115
+
+The old version used a not exsisting OID who leads to a error when using inline snmp.
diff --git a/ChangeLog b/ChangeLog
index 827a421..0f87f1e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -188,6 +188,7 @@
* 0584 FIX: agent_vsphere: special agent now handles non-standard https port
correctly...
* 0585 FIX: check_mk_agent.linux: more efficient handling of cups printer queues...
* 0703 FIX: brocade_mlx: omit inventory of cpu and memory on more states...
+ * 0137 FIX: Fixed printer_pages...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/checks/printer_pages b/checks/printer_pages
index e4660ba..a063cbc 100644
--- a/checks/printer_pages
+++ b/checks/printer_pages
@@ -24,33 +24,22 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# +------------------------------------------------------------------+
-# | This file has been contributed by: |
-# | |
-# | Peter Lauk <lauk(a)stuttgart-airport.com> Copyright 2010 |
-# +------------------------------------------------------------------+
-
def inventory_printer_pages(info):
- return [ (line[0], None ) for line in info ]
+ if len(info) > 0:
+ return [ (None, None) ]
def check_printer_pages(item, params, info):
- for line in info:
- if line[0] == item:
- infotext = "%d Pages printed" % int(line[1])
- perfdata = [ ( "pages", int(line[1]) ) ]
- return (0, "%s" % infotext, perfdata)
-
- return (3, 'not found')
-
-
-
+ pages = saveint(info[0][0])
+ infotext = "%d Pages printed" % pages
+ perfdata = [ ( "pages", pages ) ]
+ return (0, "%s" % infotext, perfdata)
check_info["printer_pages"] = {
'check_function': check_printer_pages,
'inventory_function': inventory_printer_pages,
- 'service_description': 'Pages %s',
+ 'service_description': 'Pages',
'has_perfdata': True,
- 'snmp_info': ('.1.3.6.1.2.1.43.10.2.1.4.1', [0, 1]),
+ 'snmp_info': ('.1.3.6.1.2.1.43.10.2.1.4.1', [ 1 ]),
'snmp_scan_function': \
lambda oid: oid(".1.3.6.1.2.1.43.10.2.1.4.1.1") != None,
}