1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Bug #2490: errors in probes in the monitoring system are not reported as errors

(cherry picked from commit 2cad5fc87c760d52c65d96cadb5dc9cc6d635df2)
This commit is contained in:
Jaime Melis 2013-11-25 17:51:46 +01:00 committed by Javi Fontan
parent d6438fb623
commit 6b51c53eb2

View File

@ -66,13 +66,17 @@ class CollectdClient
def run_probes
data = `#{@run_probes_cmd}`
code = $?.exitstatus == 0
data = "Error executing probes" if !code
data64 = Base64::encode64(data).strip.delete("\n")
return data64
[data64, code]
end
def send(data)
@s.send("MONITOR SUCCESS #{@number} #{data}\n", 0, @host, @port)
message, code = data
result = code ? "SUCCESS" : "FAILURE"
@s.send("MONITOR #{result} #{@number} #{message}\n", 0, @host, @port)
end
def monitor