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

Added error logging to im mad

This commit is contained in:
Javi Fontan 2010-09-08 17:56:52 +02:00
parent 3e8db30a9d
commit d5810458f5

View File

@ -57,18 +57,21 @@ class InformationManager < OpenNebulaDriver
# Execute the run_probes in the remote host
#---------------------------------------------------------------------------
def action_monitor(number, host, do_update)
log_lambda=lambda do |message|
log(number, message)
end
if do_update == "1"
# Use SCP to sync:
sync_cmd = "scp -r #{REMOTES_LOCATION}/. #{host}:#{@remote_dir}"
# Use rsync to sync:
# sync_cmd = "rsync -Laz #{REMOTES_LOCATION} #{host}:#{@remote_dir}"
LocalCommand.run(sync_cmd)
else
LocalCommand.run(sync_cmd, log_lambda)
end
cmd = SSHCommand.run("#{@remote_dir}/im/run_probes #{@hypervisor}",
host)
cmd = SSHCommand.run("#{@remote_dir}/im/run_probes #{@hypervisor}",
host, log_lambda)
if cmd.code == 0
send_message("MONITOR", RESULT[:success], number, cmd.stdout)