Paste: nagios-aggregate
Author: | crhancoc |
Mode: | ruby |
Date: | Tue, 16 Apr 2013 16:48:12 |
Plain Text |
module MCollective
class Aggregate
class Ngtetest_summation<Base
def startup_hook
@result[:value] = {}
@result[:type] = :collection
@status_map = ["OK", "WARN", "CRIT", "UNKNOWN"]
@status_map.each {|s| @result[:value][s] = 0}
@aggregate_format = "%10s : %s" unless @aggregate_format
end
def process_result(value, reply)
p value
value.each do |k,v|
status = @result[:value][k]
@result[:value][k] += v
end
end
def summarize
result_class(@result[:type]).new(@result,@aggregate_format,@action)
end
end
end
end
New Annotation