Skip to content

disk-smart: Show smartctl output on failure #671

@Cyberes

Description

@Cyberes

Describe the solution you'd like

Currently, if the smartctl command fails during the disk-check, an error message such as this will be shown:

smartctl failed with exit status "Device open failed, device did not return an IDENTIFY DEVICE structure, or device is in a low-power mode."

This is a very unhelpful error. I am aware of the --test arg, but this requires me to log into the machine and manually retrieve the info. I propose a new flag, --smartctl-stderr to print the command's output on an error so it shows up in the Icinga2 interface. Something like this:

smartctl failed with exit status "Device open failed, device did not return an IDENTIFY DEVICE structure, or device is in a low-power mode."
stdout: smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.74-1-pve] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

Read Device Identity failed: scsi error unsupported field in scsi command

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

stderr:

In this example, the error message is caused by an external USB hard drive that doesn't support smart.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions