Refactored snapin server_time to new snapin API
[check_mk.git] / checks / printer_pages_ricoh
blob0935364a386ddd4f8772c803445e433f7e244449
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
11 # +------------------------------------------------------------------+
13 # This file is part of Check_MK.
14 # The official homepage is at http://mathias-kettner.de/check_mk.
16 # check_mk is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by
18 # the Free Software Foundation in version 2. check_mk is distributed
19 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
20 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
22 # tails. You should have received a copy of the GNU General Public
23 # License along with GNU Make; see the file COPYING. If not, write
24 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
25 # Boston, MA 02110-1301 USA.
28 # 1.3.6.1.4.1.367.3.2.1.2.19.5.1.5.1 Counter: Machine Total
29 # 1.3.6.1.4.1.367.3.2.1.2.19.5.1.9.1 98040
30 # 1.3.6.1.4.1.367.3.2.1.2.19.5.1.5.21 Total Prints: Color
31 # 1.3.6.1.4.1.367.3.2.1.2.19.5.1.9.21 46226
32 # 1.3.6.1.4.1.367.3.2.1.2.19.5.1.5.22 Total Prints: Black & White
33 # 1.3.6.1.4.1.367.3.2.1.2.19.5.1.9.22 51814
36 def parse_printer_pages_ricoh(info):
37 parsed = {}
38 for name, pages_text in info:
39 if name == 'Counter: Machine Total':
40 parsed['pages_total'] = int(pages_text)
42 elif name == 'Total Prints: Color':
43 parsed['pages_color'] = int(pages_text)
45 elif name == 'Total Prints: Black & White':
46 parsed['pages_bw'] = int(pages_text)
47 return parsed
50 check_info["printer_pages_ricoh"] = {
51 'parse_function' : parse_printer_pages_ricoh,
52 'inventory_function' : inventory_printer_pages_types,
53 'check_function' : check_printer_pages_types,
54 'service_description' : 'Pages',
55 'has_perfdata' : True,
56 'snmp_info' : (".1.3.6.1.4.1.367.3.2.1.2.19.5.1", [ 5, 9 ]),
57 'snmp_scan_function' : scan_ricoh_printer,
58 'includes' : [ 'printer_pages.include' ],