diff --git a/src/im_mad/remotes/common.d/monitord-client.rb b/src/im_mad/remotes/common.d/monitord-client.rb index 724b18749f..0763c44fb0 100644 --- a/src/im_mad/remotes/common.d/monitord-client.rb +++ b/src/im_mad/remotes/common.d/monitord-client.rb @@ -216,11 +216,13 @@ begin :snapshot_vm_udp => { :period => 60, :elem_name => 'MONITOR_VM', + :method_name => :monitor_vm_udp, :path => 'vm/snapshot' }, :beacon_host_udp => { :period => config.elements['PROBES_PERIOD/BEACON_HOST'].text.to_s, + :elem_name => 'BEACON_HOST', :path => 'host/beacon' } } @@ -282,7 +284,9 @@ probes.each do |msg_type, conf| da.strip! next if da.empty? - client.send(msg_type, result == 0, da) + smethod = conf[:method_name] ? conf[:method_name] : msg_type + + client.send(smethod, result == 0, da) end end end diff --git a/src/im_mad/remotes/kvm-probes.d/vm/snapshot/recovery.rb b/src/im_mad/remotes/kvm-probes.d/vm/snapshot/recovery.rb index d77742706e..2293bc5d20 100755 --- a/src/im_mad/remotes/kvm-probes.d/vm/snapshot/recovery.rb +++ b/src/im_mad/remotes/kvm-probes.d/vm/snapshot/recovery.rb @@ -80,11 +80,11 @@ datastores.each do |ds| if s.exitstatus == 0 disk_data << \ 'DISK_RECOVERY_SNAPSHOT = ' \ - "[ ID=#{disk_id}, TIMESTAMP=#{o}]" + "[ ID=#{disk_id}, TIMESTAMP=\"#{o}\" ]" else disk_data << \ 'DISK_RECOVERY_SNAPSHOT = ' \ - "[ ID=#{disk_id}, MSG=\"ERROR #{o}\"]" + "[ ID=#{disk_id}, MSG=\"ERROR #{o}\" ]" end end @@ -92,7 +92,7 @@ datastores.each do |ds| enc_data = Base64.strict_encode64(disk_data.join("\n")) monitor_data << \ - "VM = [ ID=\"#{vm_id}\" MONITOR = \"#{enc_data}\" ]" + "VM = [ ID=\"#{vm_id}\", MONITOR=\"#{enc_data}\" ]" end end