1
0

- 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
This commit is contained in:
Ruediger Oertel 2019-12-11 17:11:36 +00:00 committed by Git OBS Bridge
parent 0cb710c31c
commit 2f4e862ed2
2 changed files with 12 additions and 6 deletions

View File

@ -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();
}
}

View File

@ -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