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:
parent
d5810458f5
commit
61b7cf367b
@ -27,6 +27,7 @@ end
|
|||||||
######
|
######
|
||||||
|
|
||||||
nodeinfo_text = `virsh -c qemu:///system nodeinfo`
|
nodeinfo_text = `virsh -c qemu:///system nodeinfo`
|
||||||
|
exit(-1) if $?!=0
|
||||||
|
|
||||||
nodeinfo_text.split(/\n/).each{|line|
|
nodeinfo_text.split(/\n/).each{|line|
|
||||||
if line.match('^CPU\(s\)')
|
if line.match('^CPU\(s\)')
|
||||||
@ -45,6 +46,8 @@ nodeinfo_text.split(/\n/).each{|line|
|
|||||||
NETINTERFACE = "eth1"
|
NETINTERFACE = "eth1"
|
||||||
|
|
||||||
top_text=`top -bin2`
|
top_text=`top -bin2`
|
||||||
|
exit(-1) if $?!=0
|
||||||
|
|
||||||
top_text.gsub!(/^top.*^top.*?$/m, "") # Strip first top output
|
top_text.gsub!(/^top.*^top.*?$/m, "") # Strip first top output
|
||||||
|
|
||||||
top_text.split(/\n/).each{|line|
|
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}'`
|
$free_memory=`free -k|grep "buffers\/cache"|awk '{print $4}'`
|
||||||
|
|
||||||
net_text=`cat /proc/net/dev`
|
net_text=`cat /proc/net/dev`
|
||||||
|
exit(-1) if $?!=0
|
||||||
|
|
||||||
net_text.split(/\n/).each{|line|
|
net_text.split(/\n/).each{|line|
|
||||||
if line.match("^ *#{NETINTERFACE}")
|
if line.match("^ *#{NETINTERFACE}")
|
||||||
|
@ -29,6 +29,11 @@ function run_dir {
|
|||||||
for i in `ls *`;do
|
for i in `ls *`;do
|
||||||
if [ -x "$i" ]; then
|
if [ -x "$i" ]; then
|
||||||
./$i
|
./$i
|
||||||
|
EXIT_CODE=$?
|
||||||
|
if [ "x$EXIT_CODE" != "x0" ]; then
|
||||||
|
echo "Error executing $i" 1>&2
|
||||||
|
exit $EXIT_CODE
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
@ -36,9 +41,23 @@ function run_dir {
|
|||||||
|
|
||||||
data=$(
|
data=$(
|
||||||
run_dir 'common.d'
|
run_dir 'common.d'
|
||||||
|
|
||||||
|
EXIT_CODE=$?
|
||||||
|
|
||||||
|
if [ "x$EXIT_CODE" != "x0" ]; then
|
||||||
|
exit $EXIT_CODE
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -d "$HYPERVISOR_DIR" ]; then
|
if [ -d "$HYPERVISOR_DIR" ]; then
|
||||||
run_dir $HYPERVISOR_DIR
|
run_dir $HYPERVISOR_DIR
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
|
|
||||||
|
EXIT_CODE=$?
|
||||||
|
|
||||||
echo $data | tr '\n' ' '
|
echo $data | tr '\n' ' '
|
||||||
|
|
||||||
|
if [ "x$EXIT_CODE" != "x0" ]; then
|
||||||
|
exit $EXIT_CODE
|
||||||
|
fi
|
||||||
|
|
||||||
|
@ -27,7 +27,10 @@ def print_info(name, value)
|
|||||||
end
|
end
|
||||||
|
|
||||||
xentop_text=`sudo #{XENTOP_PATH} -bi2`
|
xentop_text=`sudo #{XENTOP_PATH} -bi2`
|
||||||
|
exit(-1) if $?!=0
|
||||||
|
|
||||||
xm_text=`sudo #{XM_PATH} info`
|
xm_text=`sudo #{XM_PATH} info`
|
||||||
|
exit(-1) if $?!=0
|
||||||
|
|
||||||
xentop_text.gsub!(/^xentop.*^xentop.*?$/m, "") # Strip first top output
|
xentop_text.gsub!(/^xentop.*^xentop.*?$/m, "") # Strip first top output
|
||||||
xentop_text.gsub!("no limit", "no_limit")
|
xentop_text.gsub!("no limit", "no_limit")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user