Opened 3 years ago

Closed 2 years ago

#697 closed enhancement (fixed)

Optionally use exit status != 2 for "-n standby" condition

Reported by: Gabriele Pohl Owned by: Christian Franke
Priority: minor Milestone: Release 6.6
Component: smartctl Version: 6.5
Keywords: Cc:


The smartctl man page says:

Bit 1: Device open failed, device did not return an IDENTIFY DEVICE structure, 
or device is in a low-power mode (see ´-n´ option above).

Since version 5.37 we have option --nocheck=standby to monitor devices without disturbing (wake up) them in sleep / standby mode.

smartctl returning with exit status "2" is a normal condition when we call it with --nocheck=standby, but it's exit status != 0 gets interpreted as failure from 3rd party software.

see bugreport of Munin plugin hddtemp_smartctl

Is it possible to not set bit1 when smartctl is called with --nocheck=standby?

Change History (2)

comment:1 Changed 3 years ago by Christian Franke

Milestone: Release 6.6
Owner: set to Christian Franke
Status: newaccepted
Summary: clarify smart exit status "2"Optionally use exit status != 2 for "-n standby" condition

The exit status of the (~10 years old) option -n, --nocheck should not be changed unconditionally as other scripts or plugins may rely on it.

I would suggest to enhance the option such that the exit status could be configured. For example:
-n standby,0 for the above use case,
-n standby[,2] as the backward compatible default, or
-n standby,3 if a distinct detection of standby mode is desired.

comment:2 Changed 2 years ago by Christian Franke

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.