class Nagios::Promoo::Opennebula::Probes::XmlrpcHealthProbe

Probe for checking ONe XML RPC2 health.

@author Boris Parak <parak@cesnet.cz>

Public Class Methods

declaration() click to toggle source
# File lib/nagios/promoo/opennebula/probes/xmlrpc_health_probe.rb, line 21
def declaration
  'xmlrpc_health'
end
description() click to toggle source
# 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
options() click to toggle source
# File lib/nagios/promoo/opennebula/probes/xmlrpc_health_probe.rb, line 17
def options
  []
end
runnable?() click to toggle source
# File lib/nagios/promoo/opennebula/probes/xmlrpc_health_probe.rb, line 25
def runnable?
  true
end

Public Instance Methods

run(_args = []) click to toggle source
# 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