Change comparison from '==' to 'ne' for error checks

Zpool status reports error counts with unit suffixes after the first 999 errors in any given column; as originally written, the monitor-health plugin used strictly numeric comparison checks which would error out when encountering a value like "1.09K" for checksum errors.
This commit is contained in:
Jim Salter 2026-02-17 11:53:42 -05:00 committed by GitHub
parent 74b61d149f
commit d8ff385691
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

6
sanoid
View File

@ -1375,9 +1375,9 @@ sub check_zpool() {
# check for io/checksum errors
my @vdeverr = ();
if ($read != 0) { push @vdeverr, "read" };
if ($write != 0) { push @vdeverr, "write" };
if ($cksum != 0) { push @vdeverr, "cksum" };
if ($read ne 0) { push @vdeverr, "read" };
if ($write ne 0) { push @vdeverr, "write" };
if ($cksum ne 0) { push @vdeverr, "cksum" };
if (scalar @vdeverr) {
$dmge=$dmge . "(" . $dev . ":" . join(", ", @vdeverr) . " errors) ";