Skip to content

Commit

Permalink
Fix nvme attribute check-list when auto interface is given and device…
Browse files Browse the repository at this point in the history
… is nvme
  • Loading branch information
ymartin-ovh committed Mar 6, 2024
1 parent 33171bf commit 5e330b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions check_smart.pl
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@
# Apr 29, 2023: Claudio Kuenzler - Add default check on Load Cycle Count (ignore using --skip-load-cycles) (6.14.0)
# Sep 20, 2023: Yannick Martin - Fix default Percent_Lifetime_Remain threshold handling when -w is given (6.14.1)
# Sep 20, 2023: Claudio Kuenzler - Fix debug output for raw check list, fix --hide-serial in debug output (6.14.1)
# Mar 6, 2024: Yannick Martin - Fix nvme attribute check-list when auto interface is given and device is nvme (6.14.2)

use strict;
use Getopt::Long;
use File::Basename qw(basename);

my $basename = basename($0);
my $revision = '6.14.1';
my $revision = '6.14.2';

# Standard Nagios return codes
my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
Expand Down Expand Up @@ -327,7 +328,7 @@
$output_mode = "nvme";
warn "(debug) setting output mode to nvme\n" if $opt_debug;
} else {
$output_mode = "ata";
$output_mode = "ata" unless $output_mode;
}
warn "(debug) parsing line:\n$line\n" if $opt_debug;
if ($1 eq $ok_str_ata) {
Expand All @@ -347,6 +348,7 @@
warn "(debug) found model: $model\n\n" if $opt_debug;
}
if($line =~ /$line_model_nvme(.+)/){
$output_mode = "nvme";
warn "(debug) parsing line:\n$line\n\n" if $opt_debug;
$model = $1;
$model =~ s/\s{2,}/ /g;
Expand Down

0 comments on commit 5e330b2

Please sign in to comment.