Bug #2816: monitor_ds may not be reporting the available total storage in some cases

This commit is contained in:
Jaime Melis committed 2014-04-04 15:20:30 +02:00
1 parent 3098252c03
commit 66fbcb028f
1 file changed
+2
@@ -12,6 +12,8 @@ if [ $? == 0 ]; then
LVM_SIZE_CMD="sudo vgdisplay --separator : --units m -o vg_size,vg_free --nosuffix --noheadings -C"
fi
mkdir -p "$DATASTORE_LOCATION"
USED_MB=$(du -sLm $DATASTORE_LOCATION 2>/dev/null | cut -f1)
TOTAL_MB=$(df -B1M -P $DATASTORE_LOCATION 2>/dev/null | tail -n 1 | awk '{print $2}')
FREE_MB=$(df -B1M -P $DATASTORE_LOCATION 2>/dev/null | tail -n 1 | awk '{print $4}')