1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Report monitoring error if datastores are not found

This commit is contained in:
Jaime Melis 2014-03-07 12:23:53 +01:00
parent bdaa041ee3
commit 40455376b7

View File

@ -58,6 +58,12 @@ USED_MB=`du -sLm $BASE_PATH 2>/dev/null | cut -f1`
TOTAL_MB=`df -B1M -P $BASE_PATH 2>/dev/null | tail -n 1 | awk '{print $2}'`
FREE_MB=`df -B1M -P $BASE_PATH 2>/dev/null | tail -n 1 | awk '{print $4}'`
if [ -z "$USED_MB" -o -z "$TOTAL_MB" -o -z "$FREE_MB"]; then
msg="Empty monitoring data"
error_message "$msg: USED_MB=$USED_MB, TOTAL_MB=$TOTAL_MB, FREE_MB=$FREE_MB"
exit 1
fi
MONITOR_DATA=$(cat <<EOF
USED_MB=$USED_MB
TOTAL_MB=$TOTAL_MB