1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00

set MDADM sync complete to 0 if on degraded array

This commit is contained in:
SourceDoctor
2020-02-05 23:34:42 +01:00
parent 4e64a62844
commit 652ae62899

View File

@ -47,10 +47,12 @@ if [ -d /dev/md ] ; then
let "RAID_SYNC_SPEED=$($CAT $RAID/md/sync_speed)*1024"
fi
if [ "$($CAT $RAID/md/sync_completed)" = "none" ] ; then
RAID_SYNC_COMPLETED=100
else
if [ "$($CAT $RAID/md/sync_completed)" != "none" ] ; then
let "RAID_SYNC_COMPLETED=100*$($CAT $RAID/md/sync_completed)"
elif [ $RAID_DEGRADED -eq 1 ] ; then
RAID_SYNC_COMPLETED=0
else
RAID_SYNC_COMPLETED=100
fi
# divide with 2 to size like in /proc/mdstat