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 # 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 # The ewon2005cd is a vpn that can also be used to expose data from a
29 # secondary device via snmp. Unfortunately there is no way to reliably
30 # identify that secondary device
33 ewon_discovery_rules
= []
35 # configuration for the tags used in Wagner OxyReduct devices
36 # for analog measures, "levels" is provided as upper and lower bounds (warn and crit each)
37 # for digital bitfields the "expected" bitmask is provided, that is: the bits we expect to see,
38 # Anything that doesn't match this mask causes a crit status.
39 # Note: bitmasks are specified most-significant-bit to least-significant bit
40 # Some symbols have special meaning:
41 # "?" - we don't care about this flag
42 # "*" - add the flag to the infotext but don't derive a state from it
43 # "+" - add the flag to the infotext if it is set but don't derive a state from it
44 # Also, we provide the names of flags for proper info texts.
48 "levels": (1, 2, -1, -1)
52 "levels": (1, 2, -1, -1)
55 "name": "shutdown messages",
56 "levels": (1, 2, -1, -1)
59 "flags": "00000????0000000",
80 "flags": "00??????00**0101",
82 "recovery", "maintenance", "", "", "", "", "", "", "warnings", "incidents",
83 "N2 to safe area", "N2 request from safe area", "N2 via outlet", "N2 via compressor",
84 "N2-supply locked", "N2-supply open"
89 "levels": (16, 17, 14, 13),
92 "perfvar": "o2_percentage",
93 "condition_flag": (1, 15)
96 "flags": "?????000??00000*",
98 "", "", "", "", "", "luminous field", "optical alarm", "acoustic alarm", "", "",
99 "warnings", "operation report", "shutdown", "incidents", "alarm", "O2 Sensor"
109 "name": "O2 average",
110 "levels_name": "o2_levels",
111 "levels": (16, 17, 14, 13),
114 "perfvar": "o2_percentage"
122 "name": "O2 for N2-in",
127 "name": "O2 for N2-out",
132 "name": "CO2 maximum",
133 "levels": (1500, 2000, -1, -1),
137 "flags": "????++++????++++",
143 "air control shutdown",
144 "air control closed",
146 "air control active",
158 "flags": "????++++????++++",
172 "air circulation shutdown",
173 "air circulation closed",
174 "air circulation open",
175 "air circulation active",
179 "flags": "??00++++0?000001",
181 "O2 ref sensors working",
182 "O2 ref sensors projected",
183 "BMZ quick reduction",
189 "operation mode change",
202 def parse_ewon(info
):
204 for tagid
, value
, name
in info
:
205 result
.setdefault(name
, {})[int(tagid
)] = value
209 def inventory_ewon(parsed
):
210 settings
= host_extra_conf(host_name(), ewon_discovery_rules
)
213 deviceName
= settings
[0]
215 yield "eWON Status", {"device": deviceName
}
217 if deviceName
in set(["oxyreduct"]):
218 for res
in globals()["inventory_%s" % deviceName
](parsed
):
220 params
["device"] = deviceName
224 def check_ewon(item
, params
, parsed
):
225 if item
== "eWON Status":
226 if params
["device"] is None:
227 return 1, "This device requires configuration. Plese pick the device type."
228 return 0, "Configured for %s" % params
["device"]
230 deviceName
= params
["device"]
231 if deviceName
in set(["oxyreduct"]):
232 return globals()["check_%s" % deviceName
](item
, params
.get(deviceName
, {}), parsed
)
235 check_info
["ewon"] = {
236 "check_function": check_ewon
,
237 "inventory_function": inventory_ewon
,
238 "parse_function": parse_ewon
,
239 "service_description": "%s",
240 "has_perfdata": True,
241 "snmp_scan_function": lambda oid
: oid(".1.3.6.1.2.1.1.2.0") == ".1.3.6.1.4.1.8284.2.1",
243 ".1.3.6.1.4.1.8284.2.1.3.1.11.1",
247 16, #undocumented name field