Module: InternetBoxLogger::Tasks::Kibana
- Defined in:
- lib/tasks/kibana.rb
Instance Method Summary collapse
- #deploy_reports ⇒ Object
- #kibana_dashboards_path ⇒ Object
- #kibana_info ⇒ Object
- #kibana_path ⇒ Object
- #kibana_reports_source ⇒ Object
- #kibana_symlink_path ⇒ Object
- #serve_ui(port = EasyAppHelper.config[:server_port]) ⇒ Object
- #valid_kibana_path?(path) ⇒ Boolean
Instance Method Details
#deploy_reports ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/tasks/kibana.rb', line 26 def deploy_reports kibana_reports_source.each do |report_file| EasyAppHelper.puts_and_logs " - Installing '#{report_file}' to '#{kibana_dashboards_path}'" = {} FileUtils.cp report_file, kibana_dashboards_path, end end |
#kibana_dashboards_path ⇒ Object
10 11 12 |
# File 'lib/tasks/kibana.rb', line 10 def kibana_dashboards_path "#{kibana_path}/app/dashboards" end |
#kibana_info ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/tasks/kibana.rb', line 40 def kibana_info if valid_kibana_path?(kibana_path) EasyAppHelper.puts_and_logs "A valid Kibana install has been found in #{kibana_path}" else raise <<EOM No Kibana installation found in '#{kibana_path}'. You may want to update 'kibana_path' in your config to be able to use the 'deploy' target. If Kibana is not on the machine this gem is installed you may have to manually copy files located in: - #{ibl_gem_path}/config/kibana_reports into your Kibana dashboards path: - <place where your Kibana is installed>/app/dashboards EOM end end |
#kibana_path ⇒ Object
14 15 16 |
# File 'lib/tasks/kibana.rb', line 14 def kibana_path EasyAppHelper.config[:kibana_path] end |
#kibana_reports_source ⇒ Object
5 6 7 8 |
# File 'lib/tasks/kibana.rb', line 5 def kibana_reports_source reports_source = "#{ibl_gem_path}/config/kibana_reports" Dir.entries(reports_source).keep_if {|e| e =~ /_report\.json$/i }.map {|e| "#{reports_source}/#{e}"} end |
#kibana_symlink_path ⇒ Object
18 19 20 |
# File 'lib/tasks/kibana.rb', line 18 def kibana_symlink_path "#{EasyAppHelper.config.root}/public/kibana" end |
#serve_ui(port = EasyAppHelper.config[:server_port]) ⇒ Object
34 35 36 37 38 |
# File 'lib/tasks/kibana.rb', line 34 def serve_ui(port=EasyAppHelper.config[:server_port]) require 'webrick' port ||= EasyAppHelper.config[:server_port] WEBrick::HTTPServer.new(:Port => port, :DocumentRoot => kibana_path).start end |
#valid_kibana_path?(path) ⇒ Boolean
22 23 24 |
# File 'lib/tasks/kibana.rb', line 22 def valid_kibana_path? path File.exists? "#{path}/index.html" end |