Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package monitoring-plugins-smart for
openSUSE:Factory checked in at 2026-09-04 12:38:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/monitoring-plugins-smart (Old)
and /work/SRC/openSUSE:Factory/.monitoring-plugins-smart.new.1265 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "monitoring-plugins-smart"
Fri Sep 4 12:38:51 2026 rev:20 rq:1375435 version:6.18.3
Changes:
--------
---
/work/SRC/openSUSE:Factory/monitoring-plugins-smart/monitoring-plugins-smart.changes
2026-05-10 16:48:37.257507671 +0200
+++
/work/SRC/openSUSE:Factory/.monitoring-plugins-smart.new.1265/monitoring-plugins-smart.changes
2026-09-04 12:39:38.135952576 +0200
@@ -1,0 +2,6 @@
+Wed Sep 2 07:09:16 UTC 2026 - Martin Hauke <[email protected]>
+
+- Update to version 6.18.3
+ * Fix /dev/bus/ device path to support double-digits.
+
+-------------------------------------------------------------------
Old:
----
check_smart-6.18.2.tar.gz
New:
----
check_smart-6.18.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ monitoring-plugins-smart.spec ++++++
--- /var/tmp/diff_new_pack.fKLXUk/_old 2026-09-04 12:39:38.986982472 +0200
+++ /var/tmp/diff_new_pack.fKLXUk/_new 2026-09-04 12:39:38.988982542 +0200
@@ -17,7 +17,7 @@
Name: monitoring-plugins-smart
-Version: 6.18.2
+Version: 6.18.3
Release: 0
Summary: Check SMART status of a given disk
License: GPL-3.0-or-later
++++++ check_smart-6.18.2.tar.gz -> check_smart-6.18.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/check_smart-6.18.2/.github/workflows/launchhelp.yml
new/check_smart-6.18.3/.github/workflows/launchhelp.yml
--- old/check_smart-6.18.2/.github/workflows/launchhelp.yml 2026-05-09
10:15:59.000000000 +0200
+++ new/check_smart-6.18.3/.github/workflows/launchhelp.yml 2026-08-18
07:28:09.000000000 +0200
@@ -1,6 +1,6 @@
# @file launchhelp.yml
---
-name: Launch help
+name: Validate and Test
# Trigger the workflow on push or pull request
on: [push, pull_request]
@@ -9,10 +9,16 @@
validate:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v1
+ - uses: actions/checkout@v4
- name: Install perl
run: |
sudo apt-get install -qq -yy perl
+ - name: Perl syntax check
+ run: |
+ perl -c check_smart.pl
+ - name: Perl warnings check
+ run: |
+ perl -w -c check_smart.pl
- name: Launch script with --help
run: |
./check_smart.pl --help
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/check_smart-6.18.2/check_smart.pl
new/check_smart-6.18.3/check_smart.pl
--- old/check_smart-6.18.2/check_smart.pl 2026-05-09 10:15:59.000000000
+0200
+++ new/check_smart-6.18.3/check_smart.pl 2026-08-18 07:28:09.000000000
+0200
@@ -69,6 +69,8 @@
# Apr 21, 2026: Claudio Kuenzler - Fix sys path for sudo command. Detect NVME
input/output error (6.18.0)
# Apr 24, 2026: Claudio Kuenzler - Fix command injection vulnerability in
interface parameter (6.18.1)
# May 9, 2026: Claudio Kuenzler - Fix regression with symlink paths (6.18.2)
+# Aug 18, 2026: Arkadiusz Miskiewicz - Fix exit handling on smartctl error
codes (6.18.3)
+# Aug 18, 2026: Michael Metz - Fix /dev/bus/ device path to support
double-digits (6.18.3)
use strict;
use Getopt::Long;
@@ -76,11 +78,14 @@
use Cwd qw(abs_path);
my $basename = basename($0);
-my $revision = '6.18.2';
+my $revision = '6.18.3';
# Standard Nagios return codes
my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+# Severity ranking, used to escalate the status without ever lowering it
+my %STATUS_RANK=('OK'=>0,'UNKNOWN'=>1,'WARNING'=>2,'CRITICAL'=>3);
+
my @sys_path = qw(/usr/bin /bin /usr/sbin /sbin /usr/local/bin
/usr/local/sbin);
$ENV{'BASH_ENV'}='';
@@ -170,7 +175,7 @@
} else {
warn "(debug) $opt_dl is a symlink not pointing to a valid
block device, skipping\n" if $opt_debug;
}
- } elsif (-b $opt_dl || -c $opt_dl || $opt_dl =~
m/^\/dev\/bus\/\d$/) {
+ } elsif (-b $opt_dl || -c $opt_dl || $opt_dl =~
m/^\/dev\/bus\/\d{1,2}$/) {
$device .= $opt_dl."|";
} else {
warn "(debug) $opt_dl is not a valid block/character special
device!\n\n" if $opt_debug;
@@ -445,7 +450,7 @@
warn "(debug) executing:\n$full_command\n\n" if $opt_debug;
system($full_command);
- my $return_code = $?;
+ my $return_code = decoded_exit_code($?, \@error_messages);
warn "(debug) exit code:\n$return_code\n\n" if $opt_debug;
if ($return_code & 0x01) {
@@ -457,7 +462,7 @@
escalate_status('UNKNOWN');
}
if ($return_code & 0x04) {
- push(@warning_messages, 'Checksum failure');
+ push(@warning_messages, 'SMART command failed or
checksum error in SMART data');
escalate_status('WARNING');
}
if ($return_code & 0x08) {
@@ -472,7 +477,7 @@
push(@warning_messages, 'Disk may be close to failure');
escalate_status('WARNING');
}
- if ($return_code & 0x40) {
+ if (($return_code & 0x40) && !$opt_skip_error_log) {
push(@warning_messages, 'Error log contains errors');
escalate_status('WARNING');
}
@@ -495,7 +500,7 @@
warn "(debug) selftest log check activated\n\n" if
$opt_debug;
$full_command = "$smart_command -d $interface -q silent
-l selftest $device";
system($full_command);
- my $return_code = $?;
+ my $return_code = decoded_exit_code($?,
\@error_messages);
warn "(debug) exit code:\n$return_code\n\n" if
$opt_debug;
if ($return_code > 0) {
@@ -950,17 +955,30 @@
print " -v/--version: Version number\n";
}
+# Decode the wait status of system() into smartctl's exit code. Abnormal
+# termination returns 0 so that no exit status bit is read out of a signal.
+sub decoded_exit_code {
+ my ($wait_status, $messages) = @_;
+ if ($wait_status == -1) {
+ push(@$messages, "Failed to execute $smart_command");
+ escalate_status('UNKNOWN');
+ return 0;
+ }
+ if ($wait_status & 127) {
+ push(@$messages, sprintf('smartctl died with signal %d',
$wait_status & 127));
+ escalate_status('UNKNOWN');
+ return 0;
+ }
+ return $wait_status >> 8;
+}
+
# escalate an exit status IFF it's more severe than the previous exit status
sub escalate_status {
my $requested_status = shift;
- # no test for 'CRITICAL'; automatically escalates upwards
- if ($requested_status eq 'WARNING') {
- return if ($exit_status|$exit_status_local) eq 'CRITICAL';
- }
- if ($requested_status eq 'UNKNOWN') {
- return if ($exit_status|$exit_status_local) eq 'WARNING';
- return if ($exit_status|$exit_status_local) eq 'CRITICAL';
- }
- $exit_status = $requested_status;
- $exit_status_local = $requested_status;
+ # $exit_status covers all devices, $exit_status_local only the current
+ # one; raise either only when the requested status is actually worse
+ $exit_status = $requested_status
+ if $STATUS_RANK{$requested_status} >
$STATUS_RANK{$exit_status};
+ $exit_status_local = $requested_status
+ if $STATUS_RANK{$requested_status} >
$STATUS_RANK{$exit_status_local};
}