1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-22 17:57:46 +03:00

Stop im probes execution on error

This commit is contained in:
Javi Fontan 2010-09-08 17:57:17 +02:00
parent d5810458f5
commit 61b7cf367b
3 changed files with 26 additions and 0 deletions

View File

@ -27,6 +27,7 @@ end
######
nodeinfo_text = `virsh -c qemu:///system nodeinfo`
exit(-1) if $?!=0
nodeinfo_text.split(/\n/).each{|line|
if line.match('^CPU\(s\)')
@ -45,6 +46,8 @@ nodeinfo_text.split(/\n/).each{|line|
NETINTERFACE = "eth1"
top_text=`top -bin2`
exit(-1) if $?!=0
top_text.gsub!(/^top.*^top.*?$/m, "") # Strip first top output
top_text.split(/\n/).each{|line|
@ -73,6 +76,7 @@ top_text.split(/\n/).each{|line|
$free_memory=`free -k|grep "buffers\/cache"|awk '{print $4}'`
net_text=`cat /proc/net/dev`
exit(-1) if $?!=0
net_text.split(/\n/).each{|line|
if line.match("^ *#{NETINTERFACE}")

View File

@ -29,6 +29,11 @@ function run_dir {
for i in `ls *`;do
if [ -x "$i" ]; then
./$i
EXIT_CODE=$?
if [ "x$EXIT_CODE" != "x0" ]; then
echo "Error executing $i" 1>&2
exit $EXIT_CODE
fi
fi
done
)
@ -36,9 +41,23 @@ function run_dir {
data=$(
run_dir 'common.d'
EXIT_CODE=$?
if [ "x$EXIT_CODE" != "x0" ]; then
exit $EXIT_CODE
fi
if [ -d "$HYPERVISOR_DIR" ]; then
run_dir $HYPERVISOR_DIR
fi
)
EXIT_CODE=$?
echo $data | tr '\n' ' '
if [ "x$EXIT_CODE" != "x0" ]; then
exit $EXIT_CODE
fi

View File

@ -27,7 +27,10 @@ def print_info(name, value)
end
xentop_text=`sudo #{XENTOP_PATH} -bi2`
exit(-1) if $?!=0
xm_text=`sudo #{XM_PATH} info`
exit(-1) if $?!=0
xentop_text.gsub!(/^xentop.*^xentop.*?$/m, "") # Strip first top output
xentop_text.gsub!("no limit", "no_limit")