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

Feature #4217: Fix the way FREE_MB is calculated

This commit is contained in:
Jaime Melis 2016-02-04 18:36:18 +01:00
parent 122a1a1791
commit 48f2f1c410

View File

@ -58,7 +58,7 @@ PUBLIC_DIR="${XPATH_ELEMENTS[i++]}"
MONITOR_SCRIPT=$(cat <<EOF
USED_MB=\$(df -B1M -P ${PUBLIC_DIR} 2>/dev/null | tail -n 1 | awk '{print \$3}')
TOTAL_MB=\$(df -B1M -P ${PUBLIC_DIR} 2>/dev/null | tail -n 1 | awk '{print \$2}')
FREE_MB=\$(df -B1M -P ${PUBLIC_DIR} 2>/dev/null | tail -n 1 | awk '{print \$4}')
FREE_MB=\$(expr \$TOTAL_MB - \$USED_MB)
if [ -z "\$USED_MB" -o -z "\$TOTAL_MB" -o -z "\$FREE_MB" ]; then
msg="Empty value found"