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.
29 # 1: sensor type (10 = temperature)
30 # 2: sensor state (4 = ok)
31 # 3: current value (temperature)
38 def inventory_cmctc_temp(info
):
40 if saveint(line
[1]) == 10:
44 def check_cmctc_temp(item
, params
, info
):
45 for line
in info
: # , value1, value2 in info:
49 status
, current
, crit
, low
, warn
= map(int, line
[2:7])
51 return check_temperature(
54 "cmctc_temp_%s" % item
,
55 dev_levels
=(warn
, crit
),
56 dev_levels_lower
=(low
, float("-inf")), # no lower critical level specified
57 dev_status
=cmctc_translate_status(status
),
58 dev_status_name
="Unit: %s" % cmctc_translate_status_text(status
))
61 check_info
['cmctc.temp'] = {
62 "check_function": check_cmctc_temp
,
63 "inventory_function": inventory_cmctc_temp
,
65 "service_description": "Temperature %s",
66 "group": "temperature",
67 "includes": ["temperature.include", "cmctc.include"],
68 "snmp_scan_function": cmctc_snmp_scan_function
,
70 # Base to all IO units
71 ".1.3.6.1.4.1.2606.4.2",
72 # Each of the up to 4 units has its own subtree
77 # sensor type (10 = temperature)
79 # unit status: notAvail(1), lost(2), changed(3), ok(4), off(5), on(6), warning(7), tooLow(8), tooHigh(9)
83 # high value (used for critical state)
85 # low value (used for warning, if temp falls below this value)
87 # warn value (used for warning state)
89 # description (configured by user via admin interface)