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 (30 = Power PSM,)
30 # 2: sensor state (4 = ok)
31 # 3: current value (Ampere)
37 cmctc_pcm_m_sensor_types
= {
46 check_config_variables
.append("cmctc_pcm_m_sensor_types")
49 def inventory_cmctc_psm_m(info
):
50 return [(line
[7] + " " + line
[0], None)
52 if saveint(line
[1]) in cmctc_pcm_m_sensor_types
.keys()]
55 def check_cmctc_psm_m(item
, no_params
, info
):
57 if line
[7] + " " + line
[0] != item
:
59 sensor_type
= saveint(line
[1])
60 unit
= cmctc_pcm_m_sensor_types
[sensor_type
]
61 current_val
= saveint(line
[3]) / 10
62 output
= "%s at %d%s " % (line
[7], current_val
, unit
)
63 perf
= [(unit
, current_val
, "", "", "", "")]
65 return (0, output
, perf
)
66 return (2, output
, perf
)
68 return (3, "Item no found in SNMP tree")
71 check_info
["cmctc_psm_m"] = {
72 'check_function': check_cmctc_psm_m
,
73 'inventory_function': inventory_cmctc_psm_m
,
74 'service_description': 'CMC %s',
77 # Base to all IO units
78 ".1.3.6.1.4.1.2606.4.2",
79 # Each of the up to 4 units has its own subtree
84 # sensor type (10 = temperature)
86 # unit status: notAvail(1), lost(2), changed(3), ok(4), off(5), on(6), warning(7), tooLow(8), tooHigh(9)
90 # high value (used for critical state)
92 # low value (used for warning, if temp falls below this value)
94 # warn value (used for warning state)
99 'snmp_scan_function': cmctc_snmp_scan_function
,
100 "includes": ["cmctc.include"],