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