hddtemp_smartctl.in (munin-2.0.66) | : | hddtemp_smartctl.in (munin-2.0.67) | ||
---|---|---|---|---|
skipping to change at line 300 | skipping to change at line 300 | |||
print "$drive.value $1\n"; | print "$drive.value $1\n"; | |||
} else { | } else { | |||
print "$drive.value U\n"; | print "$drive.value U\n"; | |||
print "$drive.extinfo Temperature not detected in smartctl output\n"; | print "$drive.extinfo Temperature not detected in smartctl output\n"; | |||
} | } | |||
} | } | |||
sub device_for_drive { | sub device_for_drive { | |||
my ($drive) = @_; | my ($drive) = @_; | |||
my $dev = $drive =~ /(.*)(?:_\d+)$/ ? $1 : $drive; | # The purpose of the following regular expression (removing a numeric suffix | |||
starting with an | ||||
# underscore) is a mystery. But it is probably meant to detect a partition | ||||
and select the | ||||
# parent block device in such a case. | ||||
# In order to avoid misinterpreting a trailing serial number as such a parti | ||||
tion number, we | ||||
# limit the number of numeric characters after the underscore to just one or | ||||
two. | ||||
my $dev = $drive =~ /(.*)(?:_\d{1,2})$/ ? $1 : $drive; | ||||
my $fulldev = '/dev/'; | my $fulldev = '/dev/'; | |||
$fulldev .= 'rdsk/' if $^O eq 'solaris'; | $fulldev .= 'rdsk/' if $^O eq 'solaris'; | |||
$fulldev .= exists $ENV{'dev_'.$drive} ? $ENV{'dev_'.$drive} : $dev; | $fulldev .= exists $ENV{'dev_'.$drive} ? $ENV{'dev_'.$drive} : $dev; | |||
return $fulldev; | return $fulldev; | |||
} | } | |||
sub command_for_drive_device { | sub command_for_drive_device { | |||
my ($drive, $fulldev, $use_nocheck) = @_; | my ($drive, $fulldev, $use_nocheck) = @_; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 10 lines changed or added |