Refactoring: Changed all check parameters starting with an 'o' to the new rulespec...
[check_mk.git] / checks / artec_documents
bloba4889c546d4c83cd3fd78e77deb20b533aa1dae6
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2015 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.
27 # .1.3.6.1.4.1.31560.0.0.3.1.3.1.48 Amount Documents Count --> ARTEC-MIB::artecDocumentsName.1.48
28 # .1.3.6.1.4.1.31560.0.0.3.1.3.1.49 Replicate Count --> ARTEC-MIB::artecDocumentsName.1.49
29 # .1.3.6.1.4.1.31560.0.0.3.1.3.1.50 Sign count --> ARTEC-MIB::artecDocumentsName.1.50
30 # .1.3.6.1.4.1.31560.0.0.3.1.1.1.48 8861531 --> ARTEC-MIB::artecDocumentsValues.1.48
31 # .1.3.6.1.4.1.31560.0.0.3.1.1.1.49 1653573 --> ARTEC-MIB::artecDocumentsValues.1.49
32 # .1.3.6.1.4.1.31560.0.0.3.1.1.1.50 8861118 --> ARTEC-MIB::artecDocumentsValues.1.50
35 def inventory_artec_documents(info):
36 return [(None, None)]
39 def check_artec_documents(_no_item, _no_params, info):
40 now = time.time()
41 for doc_name, doc_val_str in info:
42 if doc_val_str:
43 documents = int(doc_val_str)
44 name = doc_name.replace("Count", "").replace("count", "").strip()
45 rate = get_rate(doc_name, now, documents)
46 yield 0, "%s: %d (%.2f/s)" % (name, documents, rate)
49 check_info['artec_documents'] = {
50 'inventory_function': inventory_artec_documents,
51 'check_function': check_artec_documents,
52 'service_description': 'Documents',
53 'snmp_info': (
54 ".1.3.6.1.4.1.31560.0.0.3.1",
56 "3", # artecDocumentsName
57 "1", # artecDocumentsValues
58 ]),
59 'snmp_scan_function': artec_scan_function,
60 'includes': ["artec.include"],