Skip to content
Permalink
Browse files

10441 emc_ecs_diskio: new disk IO check for Dell EMC ECS storage systems

New SNMP check for monitoring the disk IO for Dell EMC ECS (cloud storage system). Make sure to create the rule 'Hosts without system description OID' for this host.

Change-Id: I0d03d7f44d810cf5aacb9a96c50b2f323396f28c
  • Loading branch information
jonaskluger committed Nov 15, 2019
1 parent 3540f55 commit d0451e0221724a1bfbf3122ae6f290bd8af2a9ca
Showing with 214 additions and 0 deletions.
  1. +11 −0 .werks/10441
  2. +10 −0 checkman/emc_ecs_diskio
  3. +85 −0 checks/emc_ecs_diskio
  4. +108 −0 tests/unit/checks/generictests/datasets/emc_ecs_diskio.py
@@ -0,0 +1,11 @@
Title: emc_ecs_diskio: new disk IO check for Dell EMC ECS storage systems
Class: feature
Compatible: compat
Component: checks
Date: 1573826108
Edition: cre
Knowledge: undoc
Level: 1
Version: 1.7.0i1

New SNMP check for monitoring the disk IO for Dell EMC ECS (cloud storage system). Make sure to create the rule 'Hosts without system description OID' for this host.
@@ -0,0 +1,10 @@
title: diskIO
agents: snmp
catalog: hw/storagehw/emc
license: GPL
distribution: check_mk
description:
This check monitors the disk IO of Dell EMC (Elastic Cloud Storage) systems. "Levels for disk IO" can be used to set thresholds for read/write.

inventory:
For each disk a service will be created. Make sure to create the rule 'Hosts without system description OID' for this host.
@@ -0,0 +1,85 @@
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2019 mk@mathias-kettner.de |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
# The official homepage is at http://mathias-kettner.de/check_mk.
#
# check_mk is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation in version 2. check_mk is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
# tails. You should have received a copy of the GNU General Public
# License along with GNU Make; see the file COPYING. If not, write
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.


def parse_emc_ecs_diskio(info):
if not info:
return {}

parsed = {}
for line in info:
if len(line) != 6:
continue

index, name, read_size, write_size, read, write = line
try:
parsed[name] = {
'index': index,
'read_throughput': int(read_size),
'write_throughput': int(write_size),
'read_ios': int(read),
'write_ios': int(write)
}
except ValueError:
pass
return parsed


@get_parsed_item_data
def check_emc_ecs_diskio(item, params, entry):
now = time.time()
disk_data = {}
for key in ["read_ios", "write_ios", "read_throughput", "write_throughput"]:
value = entry.get(key)
if value is None:
continue
disk_data[key] = get_rate("emc_ecs_disk_io_%s.%s" % (key, item), now, value)

yield 0, '[%s]' % entry['index']

for state, infotext, perfdata in check_diskstat_dict(item, params, {item: disk_data}):
yield state, infotext, perfdata


check_info["emc_ecs_diskio"] = {
"inventory_function": discover(),
"parse_function": parse_emc_ecs_diskio,
"check_function": check_emc_ecs_diskio,
"service_description": "Disk IO %s",
"snmp_info": (
".1.3.6.1.4.1.2021.13.15.1.1",
[
"1", # diskIOIndex
"2", # diskIODevice
"3", # diskIONRead
"4", # diskIONWritten
"5", # diskIOReads
"6", # diskIOWrites
]),
"has_perfdata": True,
"group": "diskstat",
"includes": ["diskstat.include"],
}
@@ -0,0 +1,108 @@
# -*- encoding: utf-8
# yapf: disable
checkname = 'emc_ecs_diskio'

freeze_time = '1970-01-01 00:00:01'

info = [
[u'1', u'sdk', u'208537088', u'1368398848', u'3924134', u'704587945'],
[u'2', u'dm-0', u'2438861824', u'1343166464', u'4027162', u'440261948'],
[u'3', u'dm-1', u'85700608', u'0', u'20026', u'0']
]

discovery = {'': [(u'dm-0', {}), (u'dm-1', {}), (u'sdk', {})]}

checks = {
'': [
(
u'dm-0', {}, [
(0, u'[2]', []),
(
0, 'Read: 2.27 GB/s', [
(
'disk_read_throughput', 2438861824.0, None, None,
None, None
)
]
),
(
0, 'Write: 1.25 GB/s', [
(
'disk_write_throughput', 1343166464.0, None, None,
None, None
)
]
),
(
0, 'Read operations: 4027162.00 1/s', [
('disk_read_ios', 4027162.0, None, None, None, None)
]
),
(
0, 'Write operations: 440261948.00 1/s',
[('disk_write_ios', 440261948.0, None, None, None, None)]
)
]
),
(
u'dm-1', {}, [
(0, u'[3]', []),
(
0, 'Read: 81.73 MB/s', [
(
'disk_read_throughput', 85700608.0, None, None,
None, None
)
]
),
(
0, 'Write: 0.00 B/s', [
('disk_write_throughput', 0.0, None, None, None, None)
]
),
(
0, 'Read operations: 20026.00 1/s', [
('disk_read_ios', 20026.0, None, None, None, None)
]
),
(
0, 'Write operations: 0.00 1/s', [
('disk_write_ios', 0.0, None, None, None, None)
]
)
]
),
(
u'sdk', {'read': (50.0, 100.0), 'write': (1000.0, 5000.0)}, [
(0, u'[1]', []),
(
2, 'Read: 198.88 MB/s (warn/crit at 50.00 MB/s/100.00 MB/s)', [
(
'disk_read_throughput', 208537089.0, 52428800.0, 104857600.0,
None, None
)
]
),
(
1, 'Write: 1.27 GB/s (warn/crit at 1000.00 MB/s/4.88 GB/s)', [
(
'disk_write_throughput', 1368398849.0, 1048576000.0, 5242880000.0,
None, None
)
]
),
(
0, 'Read operations: 3924134.00 1/s', [
('disk_read_ios', 3924134.0, None, None, None, None)
]
),
(
0, 'Write operations: 704587945.00 1/s',
[('disk_write_ios', 704587945.0, None, None, None, None)]
)
]
)
]
}

mock_item_state = {'': (0, 0)}

0 comments on commit d0451e0

Please sign in to comment.
You can’t perform that action at this time.