Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / checks / dell_om_processors
blob86164176e59973fee945e19ff07b679f1affcb04
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.
28 def inventory_dell_om_processors(info):
29 return [(x[0], None) for x in info if x[1] != '4' and x[0] != '']
32 def check_dell_om_processors(item, _no_params, info):
33 #Probetypes found in check_openmanage3.pl
34 cpu_states = {
35 1: 'Other', # other than following values
36 2: 'Unknown', # unknown
37 3: 'Enabled', # enabled
38 4: 'User Disabled', # disabled by user via BIOS setup
39 5: 'BIOS Disabled', # disabled by BIOS (POST error)
40 6: 'Idle', # idle
43 cpu_readings = {
44 0: 'Unknown',
45 1: 'Internal Error', # Internal Error
46 2: 'Thermal Trip', # Thermal Trip
47 32: 'Configuration Error', # Configuration Error
48 128: 'Present', # Processor Present
49 256: 'Disabled', # Processor Disabled
50 512: 'Terminator Present', # Terminator Present
51 1024: 'Throttled', # Processor Throttled
54 for index, status, manuf, status2, reading in info:
55 if index == item:
56 state = 0
57 if not status:
58 status = status2
59 status = saveint(status)
60 reading = saveint(reading)
61 msg = "Cpu (%s) State: %s, CPU Reading: %s" % \
62 (manuf, cpu_states.get(status, 'ukn (%s)' % status ), cpu_readings[int(reading)])
63 if status != 3:
64 state = 2
65 if reading in [1, 32]:
66 state = 2
67 return state, msg
69 return 2, "Processor not found"
72 check_info["dell_om_processors"] = {
73 "check_function": check_dell_om_processors,
74 "inventory_function": inventory_dell_om_processors,
75 "service_description": "Processor %s",
76 # There is no other way to find out that openmanage is present.
77 "snmp_scan_function": scan_dell_om,
78 "snmp_info": (
79 ".1.3.6.1.4.1.674.10892.1.1100",
81 "30.1.2", # Index
82 "30.1.5", # Device Status
83 "30.1.8", # Manufacturerer Name
84 "30.1.9", # DeviceStatus State
85 "32.1.6", # Deive Status reading
86 ]),
87 "includes": ["dell_om.include"],