2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
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 # ails. 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 # .--output--------------------------------------------------------------.
29 # | ___ _ _| |_ _ __ _ _| |_ |
30 # | / _ \| | | | __| '_ \| | | | __| |
31 # | | (_) | |_| | |_| |_) | |_| | |_ |
32 # | \___/ \__,_|\__| .__/ \__,_|\__| |
34 # '----------------------------------------------------------------------'
36 # .1.3.6.1.4.1.31770.2.2.6.2.1.4.1.1 Inlet 1
38 # .1.3.6.1.4.1.31770.2.2.6.3.1.4.1.1.1 "00 00 00 00 FF FF 00 00 "
39 # .1.3.6.1.4.1.31770.2.2.6.3.1.4.1.1.2 "00 00 00 01 FF FF 00 00 "
40 # .1.3.6.1.4.1.31770.2.2.6.3.1.4.1.1.3 "00 00 00 02 FF FF 00 00 "
42 # .1.3.6.1.4.1.31770.2.2.6.6.1.7.1.1.1.0.0.1 "00 04 00 00 FF FF 00 00 "
43 # .1.3.6.1.4.1.31770.2.2.6.6.1.7.1.1.2.0.0.2 "00 04 00 01 FF FF 00 00 "
44 # .1.3.6.1.4.1.31770.2.2.6.6.1.7.1.1.3.0.0.3 "00 04 00 02 FF FF 00 00 "
46 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.1 1 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'........'
47 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.4 4 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'........'
48 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.5 5 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'........'
49 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.17 17 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'........'
50 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.18 18 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'........'
51 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.19 19 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'........'
52 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.20 20 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'........'
53 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.22 22 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'........'
54 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.23 23 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'........'
55 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.32 32 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'....... '
56 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.34 34 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'......."'
57 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.36 36 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'.......$'
58 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.0.0.0.255.255.0.38 38 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'.......&'
59 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.1.64.4.255.2.1.0 256 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'..@.....'
60 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.1.64.4.255.2.1.1 257 --> BACHMANN-bluenet2-MIB::bluenet2VariableType.'..@.....'
61 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.4.0.0.255.255.0.7 7 --> BACHMANN-BLUENET2-MIB::blueNet2VariableType.'........'
62 # .1.3.6.1.4.1.31770.2.2.8.2.1.6.0.4.0.0.255.255.0.8 8 --> BACHMANN-BLUENET2-MIB::blueNet2VariableType.'........'
64 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.1 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'........'
65 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.4 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'........'
66 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.5 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'........'
67 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.17 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'........'
68 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.18 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'........'
69 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.19 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'........'
70 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.20 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'........'
71 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.22 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'........'
72 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.23 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'........'
73 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.32 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'....... '
74 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.34 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'......."'
75 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.36 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'.......$'
76 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.0.0.0.255.255.0.38 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'.......&'
77 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.1.64.4.255.2.1.0 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'..@.....'
78 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.1.64.4.255.2.1.1 2 --> BACHMANN-bluenet2-MIB::bluenet2VariableStatus.'..@.....'
79 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.4.0.0.255.255.0.7 2 --> BACHMANN-BLUENET2-MIB::blueNet2VariableStatus.'........'
80 # .1.3.6.1.4.1.31770.2.2.8.2.1.7.0.4.0.0.255.255.0.8 2 --> BACHMANN-BLUENET2-MIB::blueNet2VariableStatus.'........'
82 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.1 -2 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'........'
83 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.4 -2 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'........'
84 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.5 -2 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'........'
85 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.17 -3 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'........'
86 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.18 -1 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'........'
87 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.19 -1 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'........'
88 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.20 -1 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'........'
89 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.22 -1 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'........'
90 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.23 -2 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'........'
91 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.32 -4 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'....... '
92 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.34 -4 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'......."'
93 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.36 -4 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'.......$'
94 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.0.0.0.255.255.0.38 -4 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'.......&'
95 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.1.64.4.255.2.1.0 -1 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'..@.....'
96 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.1.64.4.255.2.1.1 -1 --> BACHMANN-bluenet2-MIB::bluenet2VariableScaling.'..@.....'
97 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.4.0.0.255.255.0.7 -1 --> BACHMANN-BLUENET2-MIB::blueNet2VariableScaling.'........'
98 # .1.3.6.1.4.1.31770.2.2.8.2.1.9.0.4.0.0.255.255.0.8 -1 --> BACHMANN-BLUENET2-MIB::blueNet2VariableScaling.'........'
100 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.1 23410 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'........'
101 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.4 95 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'........'
102 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.5 351 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'........'
103 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.17 -717 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'........'
104 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.18 2234 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'........'
105 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.19 1602 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'........'
106 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.20 5180 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'........'
107 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.22 -1571 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'........'
108 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.23 4997 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'........'
109 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.32 2407491 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'....... '
110 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.34 1302485 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'......."'
111 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.36 1842643 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'.......$'
112 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.0.0.1.255.255.0.38 1842643 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'.......&'
113 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.1.64.4.255.2.1.0 260 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'..@.....'
114 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.1.64.4.255.2.1.1 369 --> BACHMANN-bluenet2-MIB::bluenet2VariableDataValue.'..@.....'
115 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.4.0.0.255.255.0.7 16 --> BACHMANN-BLUENET2-MIB::blueNet2VariableDataValue.'........'
116 # .1.3.6.1.4.1.31770.2.2.8.4.1.5.0.4.0.0.255.255.0.8 0 --> BACHMANN-BLUENET2-MIB::blueNet2VariableDataValue.'........'
119 # .--phases--------------------------------------------------------------.
121 # | _ __ | |__ __ _ ___ ___ ___ |
122 # | | '_ \| '_ \ / _` / __|/ _ \/ __| |
123 # | | |_) | | | | (_| \__ \ __/\__ \ |
124 # | | .__/|_| |_|\__,_|___/\___||___/ |
126 # +----------------------------------------------------------------------+
128 # '----------------------------------------------------------------------'
131 def parse_bluenet2_powerrail(info
):
133 "0": (0, "expected"),
134 "1": (3, "undefined"),
136 "3": (2, "error high"),
137 "4": (2, "error low"),
138 "5": (1, "warning high"),
139 "6": (1, "warning low"),
141 "8": (1, "deactivate"),
142 "9": (2, "on alarm identidy"),
143 "10": (2, "off alarm identify"),
144 "11": (2, "on alarm"),
145 "12": (2, "off alarm"),
146 "13": (1, "on warning identify"),
147 "14": (1, "off warning identify"),
148 "15": (1, "on warning"),
149 "16": (1, "off warning"),
150 "17": (0, "on identify"),
151 "18": (0, "off identify"),
154 "21": (2, "on child alarm"),
155 "22": (2, "off child alarm"),
156 "23": (1, "on child warning"),
157 "24": (1, "off child warning"),
158 "25": (2, "child alarm"),
159 "26": (1, "child warning"),
160 "27": (2, "lost child"),
164 "1": ("phases", "Phase", "voltage"),
165 "4": ("phases", "Phase", "current"),
166 "18": ("phases", "Phase", "appower"),
167 "19": ("phases", "Phase", "power"),
168 "23": ("phases", "Phase", "frequency"),
169 "7": ("rcm_phases", "RCM Phase", "differential_current_ac"),
170 "8": ("rcm_phases", "RCM Phase", "differential_current_dc"),
178 def get_item_name(descr
, index_str
):
179 return "%s %d" % (descr
, int(index_str
) + 1)
182 for oidend
, _name
in info
[0]:
183 pre_parsed
.setdefault(oidend
, {"phases": [], "rcm_phases": []})
185 for index
, what
in [(1, "phases"), (2, "rcm_phases")]:
186 for oidend
, identifier
in info
[index
]:
187 inlet_id
= ".".join(oidend
.split(".")[:2])
188 if inlet_id
in pre_parsed
:
189 pre_parsed
[inlet_id
][what
].append([str(ord(x
)) for x
in identifier
][:-1])
191 parsed
= {"phases": {}, "rcm_phases": {}, "sensors": {}}
192 for oidend
, ty
, status
, exponent_str
, _unit
, reading_str
in info
[3]:
193 status_info
= map_status
[status
]
194 reading
= float(reading_str
) * 10**int(exponent_str
)
195 oid_info
= oidend
.split(".")
196 identifier
= oid_info
[:-1]
198 if ty
in map_phase_types
:
199 phase_ty
, phase_txt
, what
= map_phase_types
[ty
]
200 for inlet_id
, inlet_info
in pre_parsed
.items():
201 if identifier
in inlet_info
[phase_ty
]:
202 phase_name
= get_item_name("%s %s" % (inlet_id
, phase_txt
), oid_info
[3])
203 parsed
[phase_ty
].setdefault(phase_name
, {})
204 parsed
[phase_ty
][phase_name
].setdefault(what
, (reading
, status_info
))
206 elif ty
in map_sensor_types
:
207 sensor_name
= get_item_name("Sensor", oid_info
[-1])
208 sensor_ty
= map_sensor_types
[ty
]
209 parsed
["sensors"].setdefault(sensor_ty
, {})
210 parsed
["sensors"][sensor_ty
].setdefault(sensor_name
, (reading
, status_info
))
215 check_info
["bluenet2_powerrail"] = {
216 'parse_function': parse_bluenet2_powerrail
,
217 'inventory_function': lambda parsed
: inventory_elphase(parsed
["phases"]),
218 'check_function': lambda item
, params
, parsed
: check_elphase(item
, params
, parsed
["phases"]),
219 'service_description': 'Inlet %s',
220 "has_perfdata": True,
221 "snmp_scan_function": lambda oid
: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.31770.2.1"
225 ".1.3.6.1.4.1.31770.2.2.6.2.1",
228 "4", # blueNet2CircuitName
231 ".1.3.6.1.4.1.31770.2.2.6.3.1",
234 "4", # blueNet2PhaseGuid
237 ".1.3.6.1.4.1.31770.2.2.6.6.1",
240 "7", # blueNet2RcmGuid
243 ".1.3.6.1.4.1.31770.2.2.8",
246 "2.1.6", # bluenet2VariableType
247 "2.1.7", # bluenet2VariableStatus
248 "2.1.9", # bluenet2VariableScaling
249 "2.1.10", # bluenet2VariableUnit
250 "4.1.5", # bluenet2VariableDataValue
253 'includes': ["elphase.include"],
254 'group': 'el_inphase',
258 # .--RCM phases----------------------------------------------------------.
259 # | ____ ____ __ __ _ |
260 # | | _ \ / ___| \/ | _ __ | |__ __ _ ___ ___ ___ |
261 # | | |_) | | | |\/| | | '_ \| '_ \ / _` / __|/ _ \/ __| |
262 # | | _ <| |___| | | | | |_) | | | | (_| \__ \ __/\__ \ |
263 # | |_| \_\\____|_| |_| | .__/|_| |_|\__,_|___/\___||___/ |
265 # '----------------------------------------------------------------------'
267 # Suggested by customer, in mA
268 factory_settings
["bluenet2_powerrail_rcm_default_levels"] = {
269 "differential_current_ac": (3.5, 30),
270 "differential_current_dc": (70, 100),
273 check_info
["bluenet2_powerrail.rcm"] = {
274 'inventory_function': lambda parsed
: inventory_elphase(parsed
["rcm_phases"]),
275 'check_function': lambda item
, params
, parsed
: check_elphase(item
, params
, parsed
["rcm_phases"]
277 "service_description": "Inlet %s",
278 "has_perfdata": True,
279 "default_levels_variable": "bluenet2_powerrail_rcm_default_levels",
280 'includes': ["elphase.include"],
281 'group': 'el_inphase',
285 # .--temperature---------------------------------------------------------.
287 # | | |_ ___ _ __ ___ _ __ ___ _ __ __ _| |_ _ _ _ __ ___ |
288 # | | __/ _ \ '_ ` _ \| '_ \ / _ \ '__/ _` | __| | | | '__/ _ \ |
289 # | | || __/ | | | | | |_) | __/ | | (_| | |_| |_| | | | __/ |
290 # | \__\___|_| |_| |_| .__/ \___|_| \__,_|\__|\__,_|_| \___| |
292 # '----------------------------------------------------------------------'
294 # Suggested by customer
295 factory_settings
["bluenet2_powerrail_temp_default_levels"] = {
300 def inventory_bluenet2_powerrail_temp(parsed
):
301 for item
in parsed
["sensors"].get("temp", {}):
305 def check_bluenet2_powerrail_temp(item
, params
, parsed
):
306 if item
in parsed
["sensors"].get("temp", {}):
307 reading
, (state
, state_readable
) = parsed
["sensors"]["temp"][item
]
308 return check_temperature(
311 "bluenet2_powerrail_temp_%s" % item
,
313 dev_status_name
=state_readable
)
316 check_info
["bluenet2_powerrail.temp"] = {
317 "inventory_function": inventory_bluenet2_powerrail_temp
,
318 "check_function": check_bluenet2_powerrail_temp
,
319 "service_description": "Temperature %s",
320 "has_perfdata": True,
321 "default_levels_variable": "bluenet2_powerrail_temp_default_levels",
322 "includes": ["temperature.include"],
323 "group": "temperature",
327 # .--humidity------------------------------------------------------------.
329 # | | |__ _ _ _ __ ___ (_) __| (_) |_ _ _ |
330 # | | '_ \| | | | '_ ` _ \| |/ _` | | __| | | | |
331 # | | | | | |_| | | | | | | | (_| | | |_| |_| | |
332 # | |_| |_|\__,_|_| |_| |_|_|\__,_|_|\__|\__, | |
334 # '----------------------------------------------------------------------'
336 # Suggested by customer
337 bluenet2_powerrail_humidity_default_levels
= (5, 8, 75, 80)
340 def inventory_bluenet2_powerrail_humidity(parsed
):
341 for item
in parsed
["sensors"].get("humidity", {}):
342 yield item
, "bluenet2_powerrail_humidity_default_levels"
345 def check_bluenet2_powerrail_humidity(item
, params
, parsed
):
346 if item
in parsed
["sensors"].get("humidity", {}):
347 reading
, (state
, state_readable
) = parsed
["sensors"]["humidity"][item
]
348 yield check_humidity(reading
, params
)
349 yield state
, state_readable
352 check_info
["bluenet2_powerrail.humidity"] = {
353 "inventory_function": inventory_bluenet2_powerrail_humidity
,
354 "check_function": check_bluenet2_powerrail_humidity
,
355 'service_description': 'Humidity %s',
356 "has_perfdata": True,
357 "includes": ["humidity.include"],