Class: Fluent::MuninNodeInput
- Inherits:
-
Input
- Object
- Input
- Fluent::MuninNodeInput
- Defined in:
- lib/fluent/plugin/in_munin_node.rb
Defined Under Namespace
Classes: TimerWatcher
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ MuninNodeInput
constructor
A new instance of MuninNodeInput.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ MuninNodeInput
Returns a new instance of MuninNodeInput.
27 28 29 30 |
# File 'lib/fluent/plugin/in_munin_node.rb', line 27 def initialize super require 'munin-ruby' end |
Instance Method Details
#configure(conf) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/fluent/plugin/in_munin_node.rb', line 32 def configure(conf) super @include_service = Regexp.new(@include_service) if @include_service @exclude_service = Regexp.new(@exclude_service) if @exclude_service end |
#shutdown ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/fluent/plugin/in_munin_node.rb', line 48 def shutdown @loop.watchers.each(&:detach) @loop.stop # XXX: Comment out for exit quickly. Is it OK? #@thread.join end |
#start ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/fluent/plugin/in_munin_node.rb', line 39 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 |