Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nvme attribute check-list when auto interface is given and device… #97

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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