Class: DogEventer::Host

Inherits:
Scope
  • Object
show all
Defined in:
lib/dogeventer/scope.rb

Instance Attribute Summary

Attributes inherited from Scope

#events

Instance Method Summary collapse

Constructor Details

#initialize(start_time, host_name) ⇒ Host

Returns a new instance of Host.



11
12
13
14
# File 'lib/dogeventer/scope.rb', line 11

def initialize(start_time, host_name)
  super start_time
  @host_name = host_name
end

Instance Method Details

#chef_run(&block) ⇒ Object



22
23
24
25
26
# File 'lib/dogeventer/scope.rb', line 22

def chef_run(&block)
  c = ChefRun.new(@host_name, @start_time)
  c.instance_eval &block
  @events += c.events
end

#nagios_check(check_name, &block) ⇒ Object



16
17
18
19
20
# File 'lib/dogeventer/scope.rb', line 16

def nagios_check(check_name, &block)
  n = NagiosCheck.new(check_name, @host_name, @start_time)
  n.instance_eval &block
  @events += n.events
end