From 66fbcb028fb9e498eeaa5955144afd2e8a2fb969 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Fri, 4 Apr 2014 15:20:03 +0200 Subject: [PATCH] Bug #2816: monitor_ds may not be reporting the available total storage in some cases --- src/im_mad/remotes/common.d/monitor_ds.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/im_mad/remotes/common.d/monitor_ds.sh b/src/im_mad/remotes/common.d/monitor_ds.sh index fb1223db72..8253c3956c 100755 --- a/src/im_mad/remotes/common.d/monitor_ds.sh +++ b/src/im_mad/remotes/common.d/monitor_ds.sh @@ -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}')