Class: Appsignal::CLI::Diagnose
- Inherits:
-
Object
- Object
- Appsignal::CLI::Diagnose
- Defined in:
- lib/appsignal/cli/diagnose.rb
Class Method Summary collapse
- .agent_version ⇒ Object
- .check_api_key ⇒ Object
- .check_ext_install ⇒ Object
- .config ⇒ Object
- .gem_version ⇒ Object
- .paths_writable ⇒ Object
- .run ⇒ Object
- .start_appsignal ⇒ Object
Class Method Details
.agent_version ⇒ Object
19 20 21 |
# File 'lib/appsignal/cli/diagnose.rb', line 19 def agent_version puts "Agent version: #{Appsignal::Extension.agent_version}" end |
.check_api_key ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/appsignal/cli/diagnose.rb', line 49 def check_api_key start_appsignal auth_check = ::Appsignal::AuthCheck.new(Appsignal.config, Appsignal.logger) status, result = auth_check.perform_with_result if status == '200' puts "Checking API key: Ok" else puts "Checking API key: Failed" end end |
.check_ext_install ⇒ Object
60 61 62 63 64 65 66 67 68 |
# File 'lib/appsignal/cli/diagnose.rb', line 60 def check_ext_install require 'bundler/cli' require "bundler/cli/common" path = Bundler::CLI::Common.select_spec('appsignal').full_gem_path log_path = "#{path.strip}/ext/install.log" puts "Showing last lines of extension install log: #{log_path}" puts File.read(log_path) puts "\n" end |
.config ⇒ Object
27 28 29 30 31 32 |
# File 'lib/appsignal/cli/diagnose.rb', line 27 def config start_appsignal Appsignal.config.config_hash.each do |key, val| puts "Config #{key}: #{val}" end end |
.gem_version ⇒ Object
15 16 17 |
# File 'lib/appsignal/cli/diagnose.rb', line 15 def gem_version puts "Gem version: #{Appsignal::VERSION}" end |
.paths_writable ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/appsignal/cli/diagnose.rb', line 34 def paths_writable start_appsignal possible_paths = [ Appsignal.config.root_path, Appsignal.config.log_file_path ] puts "Checking if required paths are writable:" possible_paths.each do |path| result = File.writable?(path) ? 'Ok' : 'Failed' puts "#{path} ...#{result}" end puts "\n" end |
.run ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/appsignal/cli/diagnose.rb', line 5 def run gem_version agent_version start_appsignal config check_api_key paths_writable check_ext_install end |