diff --git a/.werks/16871 b/.werks/16871 new file mode 100644 index 00000000000..7679be0e5cc --- /dev/null +++ b/.werks/16871 @@ -0,0 +1,11 @@ +Title: smart: Monitor SATA disks connected via HBA +Class: fix +Compatible: compat +Component: checks +Date: 1726577620 +Edition: cre +Level: 1 +Version: 2.1.0p48 + +Previously, SATA disks connected via HBA weren't monitored by the smart +agent plugin. Now, they are monitored the same way as other ATA disks. diff --git a/agents/plugins/smart b/agents/plugins/smart index 1c5d3d101ce..7f939a4444b 100755 --- a/agents/plugins/smart +++ b/agents/plugins/smart @@ -157,14 +157,14 @@ if inpath smartctl >/dev/null 2>&1; then DNAME="${VEND}_${MODEL}_${SN}" fi else - CMD="smartctl -d ata -v 9,raw48 -A $D" + CMD="smartctl -d ata -v 9,raw48 -A $D; smartctl -d sat -v 9,raw48 -A $D" fi if [ $VEND == "NVME" ]; then echo "$DNAME $VEND $MODEL" - [ -n "$CMD" ] && $CMD | sed -e '1,5d; /^$/d' + [ -n "$CMD" ] && eval "$CMD" | sed -e '1,5d; /^$/d' else - [ -n "$CMD" ] && $CMD | grep Always | grep -v -E '^190(.*)Temperature(.*)' | sed "s|^|$DNAME $VEND $MODEL |" + [ -n "$CMD" ] && eval "$CMD" | grep Always | grep -v -E '^190(.*)Temperature(.*)' | sed "s|^|$DNAME $VEND $MODEL |" fi done 2>/dev/null