diff options
author | Simon Rettberg | 2017-07-06 15:21:27 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-07-06 15:21:27 +0200 |
commit | e00925b38741944b0a02e33a18d5b13a439ea7d8 (patch) | |
tree | c390e473e8d6c5cd3050c76e76a17fac35713bb1 /core/modules/hardware-stats | |
parent | [run-virt] Some more fixes (cifs/smb), more tests etc. (diff) | |
download | mltk-e00925b38741944b0a02e33a18d5b13a439ea7d8.tar.gz mltk-e00925b38741944b0a02e33a18d5b13a439ea7d8.tar.xz mltk-e00925b38741944b0a02e33a18d5b13a439ea7d8.zip |
[hardware-stats] Include pending sectors in bad sector count
Diffstat (limited to 'core/modules/hardware-stats')
-rwxr-xr-x | core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats | 4 |
1 files changed, 4 insertions, 0 deletions
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 |