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