Module: check_mk
Branch: master
Commit: aaa8d18b0bbf0975c440315194ef5423dc8c3eb6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aaa8d18b0bbf09…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Jul 16 15:14:21 2018 +0200
6311 FIX diskstat: Ignore partitions which do not provide all necessary information
Change-Id: Ifc6adf02e8a63eefbe0836f607206ff7bb671288
---
.werks/6311 | 10 ++++++++++
checks/diskstat | 14 +++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/.werks/6311 b/.werks/6311
new file mode 100644
index 0000000..4b440d1
--- /dev/null
+++ b/.werks/6311
@@ -0,0 +1,10 @@
+Title: diskstat: Ignore partitions which do not provide all necessary information
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1531746694
+Class: fix
+
+
diff --git a/checks/diskstat b/checks/diskstat
index 95c70a6..8edb824 100644
--- a/checks/diskstat
+++ b/checks/diskstat
@@ -113,16 +113,16 @@ def parse_diskstat(info):
real_partitions = {device_name for device_name in device_names
if diskstat_diskless_pattern.match(device_name)
and re.sub('[0-9]+$', '', device_name)}
-
disks = {}
- for node_name, major, minor, device, \
- read_ios, read_merges, read_sectors, read_ticks, \
- write_ios, write_merges, write_sectors, write_ticks, \
- ios_in_prog, total_ticks, rq_ticks in proc_diskstat:
-
- if device in real_partitions:
+ for line in proc_diskstat:
+ if line[3] in real_partitions:
continue
+ node_name, major, minor, device, \
+ read_ios, read_merges, read_sectors, read_ticks, \
+ write_ios, write_merges, write_sectors, write_ticks, \
+ ios_in_prog, total_ticks, rq_ticks = line
+
if (node_name, int(major), int(minor)) in name_info:
device = name_info[(node_name, int(major), int(minor))]