2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2016 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.12148.9.1.17.3.1.1.0 1 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.0
28 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.1 2 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.1
29 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.2 3 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.2
30 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.3 4 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.3
31 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.4 5 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.4
32 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.5 6 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.5
33 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.6 7 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.6
34 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.7 8 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.7
35 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.8 9 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.8
36 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.9 10 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.9
37 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.10 11 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.10
38 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.11 12 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.11
39 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.12 13 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.12
40 # .1.3.6.1.4.1.12148.9.1.17.3.1.1.13 14 --> ELTEK-DISTRIBUTED-MIB::ioUnitID.13
41 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.0 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.0
42 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.1 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.1
43 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.2 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.2
44 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.3 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.3
45 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.4 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.4
46 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.5 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.5
47 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.6 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.6
48 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.7 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.7
49 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.8 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.8
50 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.9 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.9
51 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.10 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.10
52 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.11 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.11
53 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.12 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.12
54 # .1.3.6.1.4.1.12148.9.1.17.3.1.4.13 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed1.13
55 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.0 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.0
56 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.1 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.1
57 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.2 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.2
58 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.3 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.3
59 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.4 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.4
60 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.5 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.5
61 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.6 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.6
62 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.7 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.7
63 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.8 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.8
64 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.9 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.9
65 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.10 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.10
66 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.11 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.11
67 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.12 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.12
68 # .1.3.6.1.4.1.12148.9.1.17.3.1.6.13 0 --> ELTEK-DISTRIBUTED-MIB::ioUnitFanSpeed2.13
70 # suggested by customer
71 factory_settings
['eltek_fans_default_variables'] = {
76 def inventory_eltek_fans(info
):
78 for index
, fan1
, fan2
in info
:
80 inventory
.append(("1/%s" % index
, {}))
82 inventory
.append(("2/%s" % index
, {}))
86 def check_eltek_fans(item
, params
, info
):
87 for index
, fan1
, fan2
in info
:
88 for fan_id
, reading
in [("1", float(fan1
)), ("2", float(fan2
))]:
89 if "%s/%s" % (fan_id
, index
) == item
:
91 infotext
= "%.1f%% of max RPM" % reading
93 warn
, crit
= params
["levels"]
99 if params
.get("levels_lower", ""):
108 infotext
+= " (warn/crit %s %.1f%%/%.1f%%)" % \
109 (levelstext
, warn
, crit
)
111 return state
, infotext
114 check_info
['eltek_fans'] = {
115 'inventory_function': inventory_eltek_fans
,
116 'check_function': check_eltek_fans
,
117 'service_description': 'Fan %s',
119 ".1.3.6.1.4.1.12148.9.1.17.3.1",
122 "4", # ioUnitFanSpeed1
123 "6", # ioUnitFanSpeed2
125 'snmp_scan_function': lambda oid
: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.12148.9"),
126 'default_levels_variable': 'eltek_fans_default_variables',
127 'group': 'hw_fans_perc'