Class: Nagios::Promoo::Opennebula::Probes::XmlrpcHealthProbe

Inherits:
BaseProbe
  • Object
show all
Defined in:
lib/nagios/promoo/opennebula/probes/xmlrpc_health_probe.rb

Overview

Probe for checking ONe XML RPC2 health.

Author:

Instance Attribute Summary

Attributes inherited from BaseProbe

#options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseProbe

#client, #initialize

Constructor Details

This class inherits a constructor from Nagios::Promoo::Opennebula::Probes::BaseProbe

Class Method Details

.declarationObject



21
22
23
# File 'lib/nagios/promoo/opennebula/probes/xmlrpc_health_probe.rb', line 21

def declaration
  'xmlrpc_health'
end

.descriptionObject



13
14
15
# File 'lib/nagios/promoo/opennebula/probes/xmlrpc_health_probe.rb', line 13

def description
  ['xmlrpc-health', 'Run a probe checking OpenNebula\'s XML RPC service']
end

.optionsObject



17
18
19
# File 'lib/nagios/promoo/opennebula/probes/xmlrpc_health_probe.rb', line 17

def options
  []
end

.runnable?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/nagios/promoo/opennebula/probes/xmlrpc_health_probe.rb', line 25

def runnable?
  true
end

Instance Method Details

#run(_args = []) ⇒ Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/nagios/promoo/opennebula/probes/xmlrpc_health_probe.rb', line 30

def run(_args = [])
  rc = Timeout.timeout(options[:timeout]) { client.get_version }
  raise rc.message if OpenNebula.is_error?(rc)

  puts "XMLRPC OK - OpenNebula #{rc} daemon is up and running"
rescue => ex
  puts "XMLRPC CRITICAL - #{ex.message}"
  puts ex.backtrace if options[:debug]
  exit 2
end