2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2017 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.2606.4.2.5.6.2.1.1.1 1
28 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.1.2 2
29 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.1.3 3
30 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.2.1 18
31 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.2.2 18
32 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.2.3 18
33 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.3.1 PSM On/Off
34 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.3.2 PSM On/Off
35 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.3.3 PSM On/Off
36 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.4.1 6
37 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.4.2 6
38 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.4.3 6
39 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.5.1 1
40 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.5.2 1
41 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.5.3 1
42 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.6.1 2
43 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.6.2 2
44 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.6.3 2
45 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.7.1 1
46 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.7.2 1
47 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.7.3 1
48 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.8.1 0
49 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.8.2 0
50 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.8.3 0
51 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.9.1 1
52 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.9.2 1
53 # .1.3.6.1.4.1.2606.4.2.5.6.2.1.9.3 1
56 def parse_cmctc_output(info
):
57 def parse_output_sensor(sensor
):
60 "4": ("Door locking TS8 Ergoform", "", None),
61 "5": ("Universal lock 1 lock with power", "", None),
62 "6": ("Universal lock 2 unlock with power", "", None),
63 "7": ("Fan relay", "", None),
64 "8": ("Fan controlled", "", None),
65 "9": ("Universal relay output", "", None),
66 "10": ("Room door lock", "", None),
67 "11": ("Power output", "", None),
68 "12": ("Door lock with Master key", "", None),
69 "13": ("Door lock FR(i)", "", None),
70 "14": ("Setpoint", "", None),
71 "15": ("Setpoint temperature monitoring", u
" °C", "temp"),
72 "16": ("Hysteresis of setpoint", "", None),
73 "17": ("Command for remote control of RCT", "", None),
74 "18": ("Relay", "", None),
75 "19": ("High setpoint current monitoring", " A", "current"),
76 "20": ("Low setpoint current monitoring", " A", "current"),
77 "21": ("Retpoint temperature RTT", u
" °C", "temp"),
78 "22": ("Setpoint temperature monitoring RTT", u
" °C", "temp"),
79 "23": ("Power output 20A", u
" A", "current"),
80 "24": ("Door magnet automatic door release", "", None),
81 "30": ("Control mode", "", None),
82 "31": ("Min fan speed", " RPM", "rpm"),
83 "32": ("Min delta T", u
" °C", "temp"),
84 "33": ("Max delta T", u
" °C", "temp"),
85 "34": ("PID controller", "", None),
86 "35": ("PID controller", "", None),
87 "36": ("PID controller", "", None),
88 "37": ("Flowrate flowmeter", " l/min", "flow"),
89 "38": ("Cw value of water", "", ""),
90 "39": ("deltaT", u
" °C", "temp"),
91 "40": ("Control mode", "", None),
92 "42": ("Setpoint high voltage PSM", "V", "voltage"),
93 "43": ("Setpoint low voltage PSM", "V", "voltage"),
94 "44": ("Setpoint high current PSM", "A", "current"),
95 "45": ("Setpoint low current PSM", "A", "current"),
96 "46": ("Command PSM", "", None),
100 '1': 'not available',
119 '1': 'disable remote control',
120 '2': 'enable remote control',
129 (index
, sensor_type_id
, description
, status
, value
, command
, config
, delay
,
130 timeout_action
) = sensor
132 sensor_type
, unit
, perfkey
= type_map
.get(sensor_type_id
, ("Unknown output", "", None))
135 'status': status_map
.get(status
),
139 'command': command_map
.get(command
),
140 'config': config_map
.get(config
),
142 'timeout_action': timeout_map
.get(timeout_action
),
143 'description': description
146 if parsed
['status'] == 'not available':
149 name
= '%s %s' % (sensor_type
, index
)
155 parsed_sensor
= parse_output_sensor(sensor
)
157 name
, data
= parsed_sensor
163 def inventory_cmctc_output(parsed
):
168 def check_cmctc_output(item
, params
, parsed
):
169 sensor
= parsed
.get(item
)
182 state
= status_map
.get(sensor
['status'], 3)
183 infotext
= '[%(description)s] %(value)d%(unit)s, %(status)s' % sensor
184 if sensor
['perfkey'] is None:
185 yield state
, infotext
187 yield state
, infotext
, [(sensor
['perfkey'], sensor
['value'])]
189 yield 0, ('Command: %(command)s, Config: %(config)s, '
190 'Delay: %(delay)d, Timeout action: %(timeout_action)s') % sensor
193 check_info
['cmctc_output'] = {
194 "parse_function": parse_cmctc_output
,
195 "inventory_function": inventory_cmctc_output
,
196 "check_function": check_cmctc_output
,
197 "service_description": "%s",
198 "has_perfdata": True,
199 "snmp_scan_function": cmctc_snmp_scan_function
,
201 ".1.3.6.1.4.1.2606.4.2", # RITTAL-CMC-TC-MIB
203 "3", # cmcTcUnit1OutputTable
204 "4", # cmcTcUnit2OutputTable
205 "5", # cmcTcUnit3OutputTable
206 "6", # cmcTcUnit4OutputTable
209 "6.2.1.1", # unit1OutputIndex
210 "6.2.1.2", # unit1OutputType
211 "6.2.1.3", # unit1OutputText
212 "6.2.1.4", # unit1OutputStatus
213 "6.2.1.5", # unit1OutputValue
214 "6.2.1.6", # unit1OutputSet
215 "6.2.1.7", # unit1OutputConfig
216 "6.2.1.8", # unit1OutputDelay
217 "6.2.1.9", # unit1OutputTimeoutAction
219 "includes": ["cmctc.include"],