Skip to content

Commit

Permalink
F #4985: fix recovery_snapshots monitoring (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
xorel authored Feb 17, 2021
1 parent 6b8c01c commit 1e1770b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/im_mad/remotes/common.d/monitord-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,13 @@ def local?(hypervisor)
: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'
}
}
Expand Down Expand Up @@ -282,7 +284,9 @@ def local?(hypervisor)
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
Expand Down
6 changes: 3 additions & 3 deletions src/im_mad/remotes/kvm-probes.d/vm/snapshot/recovery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ def xml_elem(xml, xpath)
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

next if disk_data.empty?

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

Expand Down

0 comments on commit 1e1770b

Please sign in to comment.