2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2018 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 # comNET GmbH, Fabian Binder - 2018-05-08
29 # .1.3.6.1.4.1.9.9.719.1.30.11.1.3 cucsMemoryUnitRn
30 # .1.3.6.1.4.1.9.9.719.1.30.11.1.19 cucsMemoryUnitSerial
31 # .1.3.6.1.4.1.9.9.719.1.30.11.1.23 cucsMemoryUnitType
32 # .1.3.6.1.4.1.9.9.719.1.30.11.1.6 cucsMemoryUnitCapacity
33 # .1.3.6.1.4.1.9.9.719.1.30.11.1.14 cucsMemoryUnitOperability
34 # .1.3.6.1.4.1.9.9.719.1.30.11.1.17 cucsMemoryUnitPresence
37 '0': (0, "undiscovered"),
57 '20': (0, "ddr2FbDimm"),
64 def inventory_cisco_ucs_mem(info
):
65 for name
, _serial
, _memtype
, _capacity
, _status
, presence
in info
:
66 if presence
!= '11': # do not discover missing units
70 def check_cisco_ucs_mem(item
, _no_params
, info
):
71 for name
, serial
, memtype
, capacity
, status
, presence
in info
:
73 state
, state_readable
= map_operability
.get(status
,
74 (3, "Unknown, status code %s" % status
))
75 presence_state
, presence_readable
= map_presence
.get(
76 presence
, (3, "Unknown, status code %s" % presence
))
77 memtype_state
, memtype_readable
= map_memtype
.get(
78 memtype
, (3, "Unknown memory type %s" % memtype
))
79 yield state
, "Status: %s" % state_readable
80 yield presence_state
, "Presence: %s" % presence_readable
81 yield memtype_state
, "Type: %s" % memtype_readable
82 yield 0, "Size: %s MB, SN: %s" % (capacity
, serial
)
85 check_info
["cisco_ucs_mem"] = {
86 "check_function": check_cisco_ucs_mem
,
87 "inventory_function": inventory_cisco_ucs_mem
,
88 "service_description": "Memory %s",
89 "snmp_scan_function": scan_cisco_ucs
,
91 ".1.3.6.1.4.1.9.9.719.1.30.11.1",
93 "3", # cucsMemoryUnitRn
94 "19", # cucsMemoryUnitSerial
95 "23", # cucsMemoryUnitType
96 "6", # cucsMemoryUnitCapacity
97 "14", # cucsMemoryUnitOperability
98 "17", # cucsMemoryUnitPresence
100 "includes": ["cisco_ucs.include"]