Cleanup config.nodes_of
[check_mk.git] / checks / acme_temp
blob75322f9c2da1f546250000eadab352843ab75339
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2017 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.9148.3.3.1.3.1.1.2.1 0 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusType.1
28 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.2.2 0 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusType.2
29 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.2.3 0 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusType.3
30 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.2.4 0 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusType.4
31 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.2.5 0 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusType.5
32 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.2.6 0 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusType.6
33 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.3.1 CPU TEMP0 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusDescr.1
34 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.3.2 MAIN TEMP0 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusDescr.2
35 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.3.3 MAIN TEMP1 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusDescr.3
36 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.3.4 PHY TEMP0 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusDescr.4
37 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.3.5 PHY TCM5 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusDescr.5
38 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.3.6 PHY FPGA TEMP0 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusDescr.6
39 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.4.1 57 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusValue.1
40 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.4.2 33 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusValue.2
41 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.4.3 30 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusValue.3
42 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.4.4 53 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusValue.4
43 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.4.5 44 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusValue.5
44 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.4.6 53 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusValue.6
45 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.5.1 2 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureState.1
46 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.5.2 2 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureState.2
47 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.5.3 2 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureState.3
48 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.5.4 2 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureState.4
49 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.5.5 2 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureState.5
50 # .1.3.6.1.4.1.9148.3.3.1.3.1.1.5.6 2 --> ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureState.6
53 def inventory_acme_temp(info):
54 return [(descr, {}) for descr, _value_str, state in info if state != "7"]
57 def check_acme_temp(item, params, info):
58 for descr, value_str, state in info:
59 if item == descr:
60 dev_state, dev_state_readable = acme_environment_states[state]
61 return check_temperature(
62 float(value_str),
63 params,
64 "acme_temp.%s" % item,
65 dev_status=dev_state,
66 dev_status_name=dev_state_readable)
69 check_info['acme_temp'] = {
70 'inventory_function': inventory_acme_temp,
71 'check_function': check_acme_temp,
72 'service_description': 'Temperature %s',
73 'has_perfdata': True,
74 'snmp_info': (
75 '.1.3.6.1.4.1.9148.3.3.1.3.1.1',
77 "3", # ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusDescr
78 "4", # ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusValue
79 "5", # ACMEPACKET-ENVMON-MIB::apEnvMonTemperatureStatusState
80 ]),
81 'snmp_scan_function': scan_acme,
82 'includes': ['temperature.include', 'acme.include'],
83 'group': 'temperature',