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

Feature #1613: return with error if ssh connection was unsuccesful for ceph, iscsi, lvm and vmfs monitors

(cherry picked from commit 96cb95f0a95c64795f7d0fa8cb30c68fd55318e3)
This commit is contained in:
Jaime Melis 2013-07-16 12:50:35 +02:00
parent 3fca3e178d
commit 9780c7dafc
4 changed files with 40 additions and 7 deletions

View File

@ -59,9 +59,9 @@ $SUDO $RADOS df | $AWK '{
space = int(\$3/1024)
if (\$2 == "used") {var = "USED_MB" }
else if (\$2 == "avail") {var = "FREE_MB" }
else if (\$2 == "space") {var = "TOTAL_MB" }
if (\$2 == "used") {var = "USED_MB"}
else if (\$2 == "avail") {var = "FREE_MB"}
else if (\$2 == "space") {var = "TOTAL_MB"}
print var "=" space
}
@ -69,4 +69,13 @@ $SUDO $RADOS df | $AWK '{
EOF
)
ssh_monitor_and_log $HOST "$MONITOR_SCRIPT" | tr ' ' '\n'
MONITOR_DATA=$(ssh_monitor_and_log $HOST "$MONITOR_SCRIPT" 2>&1)
MONITOR_STATUS=$?
if [ "$MONITOR_STATUS" = "0" ]; then
echo "$MONITOR_DATA" | tr ' ' '\n'
else
echo "$MONITOR_DATA"
exit $MONITOR_STATUS
fi

View File

@ -66,4 +66,12 @@ echo "FREE_MB=\$FREE_MB"
EOF
)
ssh_monitor_and_log $HOST "$MONITOR_SCRIPT" | tr ' ' '\n'
MONITOR_DATA=$(ssh_monitor_and_log $HOST "$MONITOR_SCRIPT" 2>&1)
MONITOR_STATUS=$?
if [ "$MONITOR_STATUS" = "0" ]; then
echo "$MONITOR_DATA" | tr ' ' '\n'
else
echo "$MONITOR_DATA"
exit $MONITOR_STATUS
fi

View File

@ -66,4 +66,12 @@ echo "FREE_MB=\$FREE_MB"
EOF
)
ssh_monitor_and_log $HOST "$MONITOR_SCRIPT" | tr ' ' '\n'
MONITOR_DATA=$(ssh_monitor_and_log $HOST "$MONITOR_SCRIPT" 2>&1)
MONITOR_STATUS=$?
if [ "$MONITOR_STATUS" = "0" ]; then
echo "$MONITOR_DATA" | tr ' ' '\n'
else
echo "$MONITOR_DATA"
exit $MONITOR_STATUS
fi

View File

@ -68,4 +68,12 @@ echo "FREE_MB=\$FREE_MB"
EOF
)
ssh_monitor_and_log $HOST "$MONITOR_SCRIPT" | tr ' ' '\n'
MONITOR_DATA=$(ssh_monitor_and_log $HOST "$MONITOR_SCRIPT" 2>&1)
MONITOR_STATUS=$?
if [ "$MONITOR_STATUS" = "0" ]; then
echo "$MONITOR_DATA" | tr ' ' '\n'
else
echo "$MONITOR_DATA"
exit $MONITOR_STATUS
fi