Class: Fluent::MuninNodeInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_munin_node.rb

Defined Under Namespace

Classes: TimerWatcher

Instance Method Summary collapse

Constructor Details

#initializeMuninNodeInput

Returns a new instance of MuninNodeInput.



24
25
26
27
# File 'lib/fluent/plugin/in_munin_node.rb', line 24

def initialize
  super
  require 'munin-ruby'
end

Instance Method Details

#configure(conf) ⇒ Object



29
30
31
# File 'lib/fluent/plugin/in_munin_node.rb', line 29

def configure(conf)
  super
end

#shutdownObject



42
43
44
45
46
47
48
# File 'lib/fluent/plugin/in_munin_node.rb', line 42

def shutdown
  @loop.watchers.each(&:detach)
  @loop.stop

  # XXX: Comment out for exit soon. Is it OK?
  #@thread.join
end

#startObject



33
34
35
36
37
38
39
40
# File 'lib/fluent/plugin/in_munin_node.rb', line 33

def start
  super

  @loop = Coolio::Loop.new
  timer = TimerWatcher.new(@interval, true, log, &method(:fetch_items))
  @loop.attach(timer)
  @thread = Thread.new(&method(:run))
end