Ubuntu Pastebin

Paste from cherrot at Mon, 9 Feb 2015 03:20:06 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module Fluent
  class MonitorZhaochaInput < Input
    Plugin.register_input('zhaocha_monitor', self)
    
    def initialize(server, agent)
      #@agent = agent
      require 'sinatra/base'
      super
    end 

    config_param :bind, :string, :default => '0.0.0.0'
    config_param :port, :integer, :default => 42624

    def start
      log.debug "listening monitoring http server on http://#{@bind}:#{@port}"
      @thread = Thread.new {MonitorServer.run! :host => @bind, :port => @port}
    end 

    def shutdown
      @thread.join
    end 

    class MonitorServer < Sinatra::Base
      get '/' do  
        'For test'
      end 
    end 

  end 
end
Download as text