From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 60C256F9BA for ; Tue, 31 Aug 2021 15:49:04 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 43A54266C3 for ; Tue, 31 Aug 2021 15:48:34 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 1F41E26219 for ; Tue, 31 Aug 2021 15:48:30 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id DEF1844412 for ; Tue, 31 Aug 2021 15:48:29 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Tue, 31 Aug 2021 15:48:25 +0200 Message-Id: <20210831134825.581949-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.460 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, smart.rs] Subject: [pbs-devel] [PATCH proxmox-backup] tools: smart: only throw error for smartctl fatal errors X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2021 13:49:04 -0000 only bit 0-2 are fatal errors, bit 3-7 are used to indicate some drive conditions. for details see the manpage of smartctl(8) Signed-off-by: Dominik Csapak --- reported in the forum: https://forum.proxmox.com/threads/s-m-a-r-t-status-unknown.95417/ src/tools/disks/smart.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/disks/smart.rs b/src/tools/disks/smart.rs index b615603e..01054519 100644 --- a/src/tools/disks/smart.rs +++ b/src/tools/disks/smart.rs @@ -91,7 +91,9 @@ pub fn get_smart_data( }; command.arg(disk_path); - let output = crate::tools::run_command(command, None)?; + let output = crate::tools::run_command(command, Some(|exitcode| + (exitcode & 0b0111) == 0 // only bits 0-2 are fatal errors + ))?; let output: serde_json::Value = output.parse()?; -- 2.30.2