Cleanup config.nodes_of
[check_mk.git] / checks / fireeye_fans
blob7fbe7aec5554b979b976e9615009b412095ac538
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
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 # 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 # .1.3.6.1.4.1.25597.11.4.1.3.1.1.1 1 --> FE-FIREEYE-MIB::feFanIndex.1
28 # .1.3.6.1.4.1.25597.11.4.1.3.1.1.2 2 --> FE-FIREEYE-MIB::feFanIndex.2
29 # .1.3.6.1.4.1.25597.11.4.1.3.1.1.3 3 --> FE-FIREEYE-MIB::feFanIndex.3
30 # .1.3.6.1.4.1.25597.11.4.1.3.1.1.4 4 --> FE-FIREEYE-MIB::feFanIndex.4
31 # .1.3.6.1.4.1.25597.11.4.1.3.1.1.5 5 --> FE-FIREEYE-MIB::feFanIndex.5
32 # .1.3.6.1.4.1.25597.11.4.1.3.1.1.6 6 --> FE-FIREEYE-MIB::feFanIndex.6
33 # .1.3.6.1.4.1.25597.11.4.1.3.1.1.7 7 --> FE-FIREEYE-MIB::feFanIndex.7
34 # .1.3.6.1.4.1.25597.11.4.1.3.1.1.8 8 --> FE-FIREEYE-MIB::feFanIndex.8
35 # .1.3.6.1.4.1.25597.11.4.1.3.1.2.1 Ok --> FE-FIREEYE-MIB::feFanStatus.1
36 # .1.3.6.1.4.1.25597.11.4.1.3.1.2.2 Ok --> FE-FIREEYE-MIB::feFanStatus.2
37 # .1.3.6.1.4.1.25597.11.4.1.3.1.2.3 Ok --> FE-FIREEYE-MIB::feFanStatus.3
38 # .1.3.6.1.4.1.25597.11.4.1.3.1.2.4 Ok --> FE-FIREEYE-MIB::feFanStatus.4
39 # .1.3.6.1.4.1.25597.11.4.1.3.1.2.5 Ok --> FE-FIREEYE-MIB::feFanStatus.5
40 # .1.3.6.1.4.1.25597.11.4.1.3.1.2.6 Ok --> FE-FIREEYE-MIB::feFanStatus.6
41 # .1.3.6.1.4.1.25597.11.4.1.3.1.2.7 Ok --> FE-FIREEYE-MIB::feFanStatus.7
42 # .1.3.6.1.4.1.25597.11.4.1.3.1.2.8 Ok --> FE-FIREEYE-MIB::feFanStatus.8
43 # .1.3.6.1.4.1.25597.11.4.1.3.1.3.1 1 --> FE-FIREEYE-MIB::feFanIsHealthy.1
44 # .1.3.6.1.4.1.25597.11.4.1.3.1.3.2 1 --> FE-FIREEYE-MIB::feFanIsHealthy.2
45 # .1.3.6.1.4.1.25597.11.4.1.3.1.3.3 1 --> FE-FIREEYE-MIB::feFanIsHealthy.3
46 # .1.3.6.1.4.1.25597.11.4.1.3.1.3.4 1 --> FE-FIREEYE-MIB::feFanIsHealthy.4
47 # .1.3.6.1.4.1.25597.11.4.1.3.1.3.5 1 --> FE-FIREEYE-MIB::feFanIsHealthy.5
48 # .1.3.6.1.4.1.25597.11.4.1.3.1.3.6 1 --> FE-FIREEYE-MIB::feFanIsHealthy.6
49 # .1.3.6.1.4.1.25597.11.4.1.3.1.3.7 1 --> FE-FIREEYE-MIB::feFanIsHealthy.7
50 # .1.3.6.1.4.1.25597.11.4.1.3.1.3.8 1 --> FE-FIREEYE-MIB::feFanIsHealthy.8
51 # .1.3.6.1.4.1.25597.11.4.1.3.1.4.1 8281 --> FE-FIREEYE-MIB::feFanSpeed.1
52 # .1.3.6.1.4.1.25597.11.4.1.3.1.4.2 8281 --> FE-FIREEYE-MIB::feFanSpeed.2
53 # .1.3.6.1.4.1.25597.11.4.1.3.1.4.3 8281 --> FE-FIREEYE-MIB::feFanSpeed.3
54 # .1.3.6.1.4.1.25597.11.4.1.3.1.4.4 8281 --> FE-FIREEYE-MIB::feFanSpeed.4
55 # .1.3.6.1.4.1.25597.11.4.1.3.1.4.5 8281 --> FE-FIREEYE-MIB::feFanSpeed.5
56 # .1.3.6.1.4.1.25597.11.4.1.3.1.4.6 8281 --> FE-FIREEYE-MIB::feFanSpeed.6
57 # .1.3.6.1.4.1.25597.11.4.1.3.1.4.7 8281 --> FE-FIREEYE-MIB::feFanSpeed.7
58 # .1.3.6.1.4.1.25597.11.4.1.3.1.4.8 8281 --> FE-FIREEYE-MIB::feFanSpeed.8
61 def check_fireeye_fans(item, params, info):
62 for index, status, health, speed_str in info:
63 if index == item:
64 for text, (state, state_readable) in \
65 check_fireeye_states([(status, 'Status'), (health, 'Health')]).items():
66 yield state, "%s: %s" % (text, state_readable)
68 yield 0, "Speed: %s RPM" % speed_str
71 check_info["fireeye_fans"] = {
72 "inventory_function": lambda info: inventory_fireeye_generic(info, True),
73 "check_function": check_fireeye_fans,
74 "service_description": "Fan %s",
75 "snmp_info": (
76 ".1.3.6.1.4.1.25597.11.4.1.3.1",
78 "1", # FE-FIREEYE-MIB::feFanIndex
79 "2", # FE-FIREEYE-MIB::feFanStatus
80 "3", # FE-FIREEYE-MIB::feFanIsHealthy
81 "4", # FE-FIREEYE-MIB::feFanSpeed
82 ]),
83 "snmp_scan_function": scan_fireeye,
84 "includes": ["fireeye.include"]