From 2f4e862ed2c67527146dc3c9f9ef10023d7a8e19860739535f07e0f13e98de04 Mon Sep 17 00:00:00 2001 From: Ruediger Oertel Date: Wed, 11 Dec 2019 17:11:36 +0000 Subject: [PATCH] - check_iostat: sanitize dev name to properly match iostat output OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=20 --- check_iostat | 13 +++++++------ monitoring-plugins-sar-perf.changes | 5 +++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/check_iostat b/check_iostat index 2aadb49..e4f8978 100644 --- a/check_iostat +++ b/check_iostat @@ -90,16 +90,17 @@ if (-d "$disk") { close(MOUNTS); } +$disk =~ s/^\/dev\/mapper\///; +$disk =~ s/^\/dev\///; + if (! -b "/dev/$disk") { if (-b "/dev/mapper/$disk") { my @f = stat("/dev/mapper/$disk"); - $f[6] %= 256; - $disk = "dm-$f[6]"; - } elsif (-b $disk) { - # take as is + $f[6] %= 256; + $disk = "dm-$f[6]"; } else { - warn "ERROR: Device incorrectly specified\n"; - HELP_MESSAGE(); + warn "ERROR: Device incorrectly specified\n"; + HELP_MESSAGE(); } } diff --git a/monitoring-plugins-sar-perf.changes b/monitoring-plugins-sar-perf.changes index e38a303..8b19d71 100644 --- a/monitoring-plugins-sar-perf.changes +++ b/monitoring-plugins-sar-perf.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Dec 11 18:10:48 CET 2019 - ro@suse.de + +- check_iostat: sanitize dev name to properly match iostat output + ------------------------------------------------------------------- Thu Dec 5 16:34:19 CET 2019 - ro@suse.de