Created
December 12, 2012 08:00
-
-
Save dmytro/4265948 to your computer and use it in GitHub Desktop.
RAG Checks for Nagios
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rag | |
rag = -1 | |
res = @connection.send(@key[:name]).send(@key[:function].to_sym) | |
thresholds = @key[:rag].reverse | |
thresholds.each_index do |idx| | |
val = thresholds[idx] | |
rag = idx if res.send(@key[:operator].to_sym, val) | |
end | |
{ | |
:service_description => "#{@bucket}: #{@key[:name]}", | |
:host_name => hostname, | |
:plugin_output => res, | |
:return_code => rag | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment