From e00925b38741944b0a02e33a18d5b13a439ea7d8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 6 Jul 2017 15:21:27 +0200 Subject: [hardware-stats] Include pending sectors in bad sector count --- .../hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats') diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats index e87c41e1..618326aa 100755 --- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats +++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats @@ -199,12 +199,16 @@ if which smartctl; then OVERALL=$(grep -o "test result: .*$" "$FILE" | cut -c 14-) [ "x$OVERALL" = "xPASSED" ] && OVERALL="" REALLOC=$(grep "^ *5 " "$FILE" | awk '{print $8}') + PENDING=$(grep "^ *197 " "$FILE" | awk '{print $8}') SPINRETRY_VAL=$(grep "^ *10 " "$FILE" | awk '{print $4}') SPINRETRY_THR=$(grep "^ *10 " "$FILE" | awk '{print $6}') [ -n "$OVERALL" ] && BADSECTORS=$(( $BADSECTORS + 100 )) if [ -n "$REALLOC" ] && [ "$REALLOC" -gt "0" ]; then BADSECTORS=$(( $BADSECTORS + $REALLOC )) fi + if [ -n "$PENDING" ] && [ "$PENDING" -gt "5" ]; then + BADSECTORS=$(( $BADSECTORS + $PENDING )) + fi if [ -n "$SPINRETRY_VAL" ] && [ "$SPINRETRY_VAL" -le "$SPINRETRY_THR" ]; then BADSECTORS=$(( $BADSECTORS + 100 )) fi -- cgit v1.2.3-55-g7522