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.10222.2.1.2.9.1.1.1.1.1 1 --> ICS-CHASSIS-MIB::icsChassisSlotIndex.1.1.1
28 # .1.3.6.1.4.1.10222.2.1.2.9.1.1.1.2.1 2 --> ICS-CHASSIS-MIB::icsChassisSlotIndex.1.2.1
30 # .1.3.6.1.4.1.10222.2.1.9.8.1.2.1.1.1 2 --> ICS-CHASSIS-MIB::icsChassisSensorSlotType.1.1.1
31 # .1.3.6.1.4.1.10222.2.1.9.8.1.2.1.1.2 2 --> ICS-CHASSIS-MIB::icsChassisSensorSlotType.1.1.2
32 # .1.3.6.1.4.1.10222.2.1.9.8.1.2.1.2.1 2 --> ICS-CHASSIS-MIB::icsChassisSensorSlotType.1.2.1
33 # .1.3.6.1.4.1.10222.2.1.9.8.1.2.1.2.2 2 --> ICS-CHASSIS-MIB::icsChassisSensorSlotType.1.2.2
34 # .1.3.6.1.4.1.10222.2.1.9.8.1.3.1.1.1 4 --> ICS-CHASSIS-MIB::icsChassisSensorSlotOperStatus.1.1.1
35 # .1.3.6.1.4.1.10222.2.1.9.8.1.3.1.1.2 4 --> ICS-CHASSIS-MIB::icsChassisSensorSlotOperStatus.1.1.2
36 # .1.3.6.1.4.1.10222.2.1.9.8.1.3.1.2.1 4 --> ICS-CHASSIS-MIB::icsChassisSensorSlotOperStatus.1.2.1
37 # .1.3.6.1.4.1.10222.2.1.9.8.1.3.1.2.2 4 --> ICS-CHASSIS-MIB::icsChassisSensorSlotOperStatus.1.2.2
38 # .1.3.6.1.4.1.10222.2.1.9.8.1.7.1.1.1 FUSION -- baseboard temp --> ICS-CHASSIS-MIB::icsChassisSensorSlotDescription.1.1.1
39 # .1.3.6.1.4.1.10222.2.1.9.8.1.7.1.1.2 FUSION -- fusion temp --> ICS-CHASSIS-MIB::icsChassisSensorSlotDescription.1.1.2
40 # .1.3.6.1.4.1.10222.2.1.9.8.1.7.1.2.1 FUSION -- baseboard temp --> ICS-CHASSIS-MIB::icsChassisSensorSlotDescription.1.2.1
41 # .1.3.6.1.4.1.10222.2.1.9.8.1.7.1.2.2 FUSION -- fusion temp --> ICS-CHASSIS-MIB::icsChassisSensorSlotDescription.1.2.2
42 # .1.3.6.1.4.1.10222.2.1.9.8.1.8.1.1.1 41 --> ICS-CHASSIS-MIB::icsChassisSensorSlotValue.1.1.1
43 # .1.3.6.1.4.1.10222.2.1.9.8.1.8.1.1.2 32 --> ICS-CHASSIS-MIB::icsChassisSensorSlotValue.1.1.2
44 # .1.3.6.1.4.1.10222.2.1.9.8.1.8.1.2.1 49 --> ICS-CHASSIS-MIB::icsChassisSensorSlotValue.1.2.1
45 # .1.3.6.1.4.1.10222.2.1.9.8.1.8.1.2.2 31 --> ICS-CHASSIS-MIB::icsChassisSensorSlotValue.1.2.2
48 def parse_intel_true_scale_sensors(info
):
62 "12": "shuttle master",
63 "13": "shuttle slave",
95 for slot_id
, slot_ty
in slots
:
96 parsed
.setdefault("slot %s" % slot_id
, {"slot_type": map_slot_types
[slot_ty
]})
98 for oid_end
, ty
, status
, descr
, reading_str
in sensors
:
99 slot_id
, sensor_id
= oid_end
.split(".")[1:]
100 slot_name
= "slot %s" % slot_id
101 sensor_name
= " ".join(descr
.split(" ")[2:-1])
103 # We do not known for all sensors. Feel free to extend
109 state
, state_readable
= map_states
[status
]
110 kwargs
= {"dev_status": state
, "dev_status_name": state_readable
}
112 sensor_ty
= map_sensor_types
[ty
]
113 parsed
[slot_name
].setdefault(sensor_ty
, [])
114 parsed
[slot_name
][sensor_ty
].append(("%s %s" % (sensor_id
, sensor_name
),
115 float(reading_str
) * factor
, kwargs
))
120 # .--temperature---------------------------------------------------------.
122 # | | |_ ___ _ __ ___ _ __ ___ _ __ __ _| |_ _ _ _ __ ___ |
123 # | | __/ _ \ '_ ` _ \| '_ \ / _ \ '__/ _` | __| | | | '__/ _ \ |
124 # | | || __/ | | | | | |_) | __/ | | (_| | |_| |_| | | | __/ |
125 # | \__\___|_| |_| |_| .__/ \___|_| \__,_|\__|\__,_|_| \___| |
127 # +----------------------------------------------------------------------+
129 # '----------------------------------------------------------------------'
132 def inventory_intel_true_scale_sensors_temp(parsed
):
133 for slot_name
, slot_info
in parsed
.items():
134 if slot_info
.get("temp"):
138 def check_intel_true_scale_sensors_temp(item
, params
, parsed
):
140 yield check_temperature_list(parsed
[item
]["temp"], params
,
141 "intel_true_scale_sensors_temp_%s" % item
)
144 check_info
['intel_true_scale_sensors_temp'] = {
145 'parse_function': parse_intel_true_scale_sensors
,
146 'inventory_function': inventory_intel_true_scale_sensors_temp
,
147 'check_function': check_intel_true_scale_sensors_temp
,
148 'service_description': 'Temperature sensors %s',
149 'has_perfdata': True,
152 ".1.3.6.1.4.1.10222.2.1.2.9.1",
154 "1", # ICS-CHASSIS-MIB::icsChassisSlotIndex
155 "3", # ICS-CHASSIS-MIB::icsChassisSlotCardType
158 ".1.3.6.1.4.1.10222.2.1.9.8.1",
161 "2", # icsChassisSensorSlotType
162 "3", # icsChassisSensorSlotOperStatus
163 "7", # icsChassisSensorSlotDescription
164 "8", # icsChassisSensorSlotValue
167 'snmp_scan_function': scan_intel_true_scale
,
168 'includes': ['temperature.include', 'intel_true_scale.include'],