Refactoring: Changed all check parameters starting with an 'o' to the new rulespec...
[check_mk.git] / checks / emc_isilon_fans
blobbf655ed25aee3e9ec46d2ba9c1c8bae72dcdf8e6
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
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.
27 factory_settings["emc_isilon_fan_default_levels"] = {"lower": (3000, 2500)}
30 # Examples for sensor names:
31 # Chassis Fan1 (ISI F1) --> Chassis 1
32 # Chassis Fan2 (ISI F2)
33 # Chassis Fan3 (ISI F3)
34 # Power Supply 1 Fan1 --> Power Supply 1 1
35 # Power Supply 2 Fan1
36 def isilon_fan_item_name(sensor_name):
37 return sensor_name.replace("Fan", "").split("(")[0].strip()
40 def inventory_emc_isilon_fans(info):
41 for fan_name, _value in info:
42 yield isilon_fan_item_name(fan_name), {}
45 def check_emc_isilon_fans(item, params, info):
46 for fan_name, value in info:
47 if item == isilon_fan_item_name(fan_name):
48 return check_fan(float(value), params)
51 check_info["emc_isilon_fans"] = {
52 'check_function': check_emc_isilon_fans,
53 'inventory_function': inventory_emc_isilon_fans,
54 'service_description': 'Fan %s',
55 'snmp_info': (
56 '.1.3.6.1.4.1.12124.2.53.1',
58 3, # ISILON-MIB::fanDescription,
59 4, # ISILON-MIB::fanSpeed,
60 ]),
61 'snmp_scan_function': lambda oid: "isilon" in oid('.1.3.6.1.2.1.1.1.0').lower(),
62 'has_perfdata': True,
63 'group': "hw_fans",
64 'default_levels_variable': "emc_isilon_fan_default_levels",
65 'includes': ['fan.include'],