Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / checks / carel_uniflair_cooling
blob8aa6ec8fffb1812ef04978d9fbe1b417c6712036
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.
27 # snmp_scan_function
28 # .1.3.6.1.2.1.1.4.0 = STRING: x.name@green-cooling.de < green-cooling match
29 # .1.3.6.1.2.1.1.5.0 = STRING: pCOWeb < pcoweb match
30 # .1.3.6.1.4.1.9839.1 < exists
32 # snmp_info
33 # .1.3.6.1.4.1.9839.2.1.1.31.0 = INTEGER: 0 < Waterloss
34 # .1.3.6.1.4.1.9839.2.1.1.51.0 = INTEGER: 1 < Global
35 # .1.3.6.1.4.1.9839.2.1.1.67.0 = INTEGER: 0 < Unit in Emergeny operation
36 # .1.3.6.1.4.1.9839.2.1.2.6.0 = INTEGER: 246 < Humidifier: Relative Humidity
39 def inventory_carel_uniflair_cooling(info):
40 return [(None, None)]
43 def check_carel_uniflair_cooling(item, _no_params, info):
44 waterloss, global_status, ermergency_op, humidity = info[0]
46 err_waterloss = waterloss != "0"
47 err_global_status = global_status != "1"
48 err_emergency_op = ermergency_op != "0"
49 humidity = float(humidity) / 10
51 output = ""
52 output = output + ("Global Status: %s" % (err_global_status and "Error(!!), " or "OK, "))
53 output = output + ("Emergency Operation: %s" %
54 (err_emergency_op and "Active(!!), " or "Inactive, "))
55 output = output + ("Humidifier: %s" %
56 (err_waterloss and "Water Loss(!!), " or "No Water Loss, "))
57 output = output + "Humidity: %3.1f%%" % humidity
59 perfdata = [("humidity", humidity)]
60 if err_waterloss or err_global_status or err_emergency_op:
61 return (2, output, perfdata)
62 return (0, output, perfdata)
65 check_info["carel_uniflair_cooling"] = {
66 "check_function": check_carel_uniflair_cooling,
67 "inventory_function": inventory_carel_uniflair_cooling,
68 "service_description": "Carel uniflair cooling",
69 "has_perfdata": True,
70 # All the OIDs of this checks seems to be wrong for the current version
71 # of this device, so the scan function is disbaled until we have better information
72 "snmp_scan_function": lambda oid: False,
73 #"snmp_scan_function" : lambda oid: ("pCO" in oid(".1.3.6.1.2.1.1.1.0")
74 # or "Linux" in oid(".1.3.6.1.2.1.1.1.0")) \
75 # and oid(".1.3.6.1.4.1.9839.1.2.0"),
76 "snmp_info": (
77 ".1.3.6.1.4.1.9839.2.1",
79 "1.31.0", # Waterloss
80 "1.51.0", # Global
81 "1.67.0", # Unit in Emergency operation
82 "2.6.0", # Relative Humidity
83 ]),