fix #1123: modify NVME device path for SMART support
seems like we need to drop the namespace part before calling smartctl. note that NVME devices require smartmontools >= 6.5
This commit is contained in:
committed by
Dietmar Maurer
parent
16bf963b94
commit
c9bd3d22b2
@ -77,6 +77,10 @@ sub get_smart_data {
|
|||||||
my $type;
|
my $type;
|
||||||
|
|
||||||
my $returncode = 0;
|
my $returncode = 0;
|
||||||
|
|
||||||
|
$disk =~ s/n\d+$//
|
||||||
|
if $disk =~ m!^/dev/nvme\d+n\d+$!;
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$returncode = run_command([$SMARTCTL, '-H', '-A', '-f', 'brief', $disk], noerr => 1, outfunc => sub{
|
$returncode = run_command([$SMARTCTL, '-H', '-A', '-f', 'brief', $disk], noerr => 1, outfunc => sub{
|
||||||
my ($line) = @_;
|
my ($line) = @_;
|
||||||
@ -134,6 +138,8 @@ sub get_smart_health {
|
|||||||
return "NOT A DEVICE" if !assert_blockdev($disk, 1);
|
return "NOT A DEVICE" if !assert_blockdev($disk, 1);
|
||||||
|
|
||||||
my $message;
|
my $message;
|
||||||
|
$disk =~ s/n\d+$//
|
||||||
|
if $disk =~ m!^/dev/nvme\d+n\d+$!;
|
||||||
|
|
||||||
run_command([$SMARTCTL, '-H', $disk], noerr => 1, outfunc => sub {
|
run_command([$SMARTCTL, '-H', $disk], noerr => 1, outfunc => sub {
|
||||||
my ($line) = @_;
|
my ($line) = @_;
|
||||||
|
|||||||
Reference in New Issue
Block a user