Class: Livestatus::Host

Inherits:
Base
  • Object
show all
Includes:
CheckType, ID, State
Defined in:
lib/livestatus/models/host.rb

Instance Attribute Summary

Attributes inherited from Base

#data

Instance Method Summary collapse

Methods included from State

#state, #state_class, #state_type

Methods included from CheckType

#check_type

Methods included from ID

#id

Methods inherited from Base

boolean_attributes, #initialize, #method_missing, table_name, time_attributes

Constructor Details

This class inherits a constructor from Livestatus::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Livestatus::Base

Instance Method Details

#_idObject



30
31
32
# File 'lib/livestatus/models/host.rb', line 30

def _id
  display_name
end

#servicesObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/livestatus/models/host.rb', line 17

def services
  if @connection
    @data[:services].map do |service|
      @connection.get(Livestatus::Service, :filter => [
        "host_name = #{name}",
        "display_name = #{service}"
      ]).first
    end
  else
    @data[:services]
  end
end