Fix + discover NMVe
This commit is contained in:
parent
34d19c8622
commit
e5047e7b92
|
@ -36,6 +36,10 @@ sub list_smart_hdd{
|
||||||
foreach my $line (@smart_info){
|
foreach my $line (@smart_info){
|
||||||
if ($line =~ m/^SMART support is:\s+Enabled/i){
|
if ($line =~ m/^SMART support is:\s+Enabled/i){
|
||||||
$smart_enabled = 1;
|
$smart_enabled = 1;
|
||||||
|
last;
|
||||||
|
elsif ($line =~ m/NVMe/i){
|
||||||
|
$smart_enabled = 1;
|
||||||
|
last;
|
||||||
} elsif ($line =~ m/^Transport protocol:\s+iSCSI/i){
|
} elsif ($line =~ m/^Transport protocol:\s+iSCSI/i){
|
||||||
# Skip iSCSI block
|
# Skip iSCSI block
|
||||||
next BLOCK;
|
next BLOCK;
|
||||||
|
|
|
@ -276,7 +276,7 @@ if ($lmsensor && -x $lmsensor){
|
||||||
$sensor->{description} = $name;
|
$sensor->{description} = $name;
|
||||||
$sensor->{type} = 'temp';
|
$sensor->{type} = 'temp';
|
||||||
$sensor->{unit} = '°C';
|
$sensor->{unit} = '°C';
|
||||||
$sensor->{cmd} = "$lmsensor | perl -ne 'if (/^$name:\\s*\\+(\\d+)/) { print \"\$1\\n\"; last }'"
|
$sensor->{cmd} = "$lmsensor | perl -ne 'if (/^$name:\\s*\\+(\\d+)/) { print \"\$1\\n\"; last }'";
|
||||||
my $id = sensor_name($name);
|
my $id = sensor_name($name);
|
||||||
$sensors->{$id} = $sensor;
|
$sensors->{$id} = $sensor;
|
||||||
print "Found a temperature sensor using lm_sensors: $name\n";
|
print "Found a temperature sensor using lm_sensors: $name\n";
|
||||||
|
@ -297,7 +297,7 @@ if ($smartctl && -x $smartctl){
|
||||||
threshold_high => $def_hd_temp_thres_high,
|
threshold_high => $def_hd_temp_thres_high,
|
||||||
type => 'temp',
|
type => 'temp',
|
||||||
unit => '°C',
|
unit => '°C',
|
||||||
cmd => "$smartctl -A /dev/$block | perl -ne 'if (/Temperature_Celsius(\\s+[^\\s]+){7}\\s+(\\d+(\.\d+)?)/) { print \"\$2\\n\"; last }'"
|
cmd => "$smartctl -A /dev/$block | perl -ne 'if (/Temperature_Celsius(\\s+[^\\s]+){7}\\s+(\\d+(\\.\\d+)?)/) { print \"\$2\\n\"; last }'"
|
||||||
};
|
};
|
||||||
print "Found a temperature sensor using smartctl: $block\n";
|
print "Found a temperature sensor using smartctl: $block\n";
|
||||||
last;
|
last;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user