GUI CSS: Deployed view styles for layouts (CMK-1171)
[check_mk.git] / checks / fireeye_temp
blob2c6f2e07a6181375cf683d032e1c0b69b71f8027
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.1.1.4.0 32 --> FE-FIREEYE-MIB::feTemperatureValue.0
28 # .1.3.6.1.4.1.25597.11.1.1.5.0 Good --> FE-FIREEYE-MIB::feTemperatureStatus.0
29 # .1.3.6.1.4.1.25597.11.1.1.6.0 1 --> FE-FIREEYE-MIB::feTemperatureIsHealthy.0
32 def inventory_fireeye_temp(info):
33 if info:
34 return [("system", {})]
37 def check_fireeye_temp(item, params, info):
38 reading_str, status, health = info[0]
39 dev_status = 0
40 dev_status_name = ""
41 for text, (state, state_readable) in \
42 check_fireeye_states([(status, 'Status'), (health, 'Health')]).items():
43 dev_status = max(dev_status, state)
44 dev_status_name += "%s: %s" % (text, state_readable)
46 yield check_temperature(
47 float(reading_str),
48 params,
49 "fireeye_temp_system",
50 dev_status=dev_status,
51 dev_status_name=dev_status_name)
54 check_info["fireeye_temp"] = {
55 "inventory_function": inventory_fireeye_temp,
56 "check_function": check_fireeye_temp,
57 "service_description": "Temperature %s",
58 "has_perfdata": True,
59 "snmp_info": (
60 ".1.3.6.1.4.1.25597.11.1.1",
62 "4", # FE-FIREEYE-MIB::feTemperatureValue
63 "5", # FE-FIREEYE-MIB::feTemperatureStatus
64 "6", # FE-FIREEYE-MIB::feTemperatureIsHealthy
65 ]),
66 "snmp_scan_function": scan_fireeye,
67 "group": "temperature",
68 "includes": ["temperature.include", "fireeye.include"],