class OpennebulaProbe
OpennebulaProbe
covers generic implementation of subprobes.
Attributes¶ ↑
-
logger - Logger connector.
-
message - Resulting message.
-
retval - Probe status constant.
-
endpoint - Server URI.
Options¶ ↑
-
opts - Hash with parsed command line arguments.
Examples¶ ↑
Instance is initialized from child class
Constants
- CRIT_MSG
- OK_MSG
- UNKWN_MSG
- WARN_MSG
Attributes
logger[W]
message[R]
retval[R]
Public Class Methods
new(opts = {})
click to toggle source
# File lib/probe/opennebula_probe.rb, line 57 def initialize(opts = {}) @opts = opts @retval = UNKNOWN @logger = nil @message = "#{UNKWN_MSG}" @endpoint = "#{@opts.protocol.to_s}://#{@opts.hostname}:#{@opts.port.to_s}#{@opts.path}" end
Public Instance Methods
check_crit()
click to toggle source
# File lib/probe/opennebula_probe.rb, line 65 def check_crit # overridden in child class true end
check_warn()
click to toggle source
# File lib/probe/opennebula_probe.rb, line 70 def check_warn # overridden in child class true end
crit?()
click to toggle source
# File lib/probe/opennebula_probe.rb, line 75 def crit? return false unless check_crit @retval = CRITICAL @message = "CRITICAL: #{CRIT_MSG}" true end
run()
click to toggle source
# File lib/probe/opennebula_probe.rb, line 89 def run unless crit? unless warn? @retval = OK @message = "#{OK_MSG}" end end end
warn?()
click to toggle source
# File lib/probe/opennebula_probe.rb, line 82 def warn? return false unless check_warn @retval = WARNING @message = "WARNING: #{WARN_MSG}" true end