Sha256: a0f2462c6c7253436def0528658efeebe47e772b92c7627b8d0bef59d0b8286d

Contents?: true

Size: 966 Bytes

Versions: 38

Compression:

Stored size: 966 Bytes

Contents

if abiquo_installed?

def abiquo_tomcat_running?
  return false if not File.exist?(TOMCAT_PID_FILE)

  pid = File.read(TOMCAT_PID_FILE)
  if `ps #{pid}`.lines.count > 1
    return true
  end
  false
end

def tomcat_mem_limits
  return ['unknown','unknown', 'unknown'] if not File.exist?(TOMCAT_PID_FILE)
  pid = File.read(TOMCAT_PID_FILE)
  `ps #{pid}` =~ /-XX:MaxPermSize=(.*?)\s/
  perm_size = $1 || 'unknown'
  `ps #{pid}` =~ /-Xms(.*?)\s/
  xms = $1 || 'unknown'
  `ps #{pid}` =~ /-Xmx(.*?)\s/
  xmx = $1 || 'unknown'
  [perm_size, xms, xmx]
end

puts "Abiquo Service:".bold.ljust(40) + (system_service_on?('abiquo-tomcat') ? 'Active'.green.bold : 'Disabled'.red.bold)

puts "Abiquo Tomcat Status:".bold.ljust(40) + (abiquo_tomcat_running? ? 'Running'.green.bold : "Stopped".red.bold)

if abiquo_tomcat_running?
  p = tomcat_mem_limits
  puts "Tomcat Mem Params:".bold.ljust(40) + "PERM: #{p[0].blue.bold} MIN: #{p[1].blue.bold} MAX: #{p[2].blue.bold}"
end

end

Version data entries

38 entries across 24 versions & 1 rubygems

Version Path
abiquo-etk-0.5.8 lib/checks/1.7.6/abiquo_service.rb
abiquo-etk-0.5.3 lib/checks/1.7.5/abiquo_service.rb
abiquo-etk-0.4.42 lib/checks/abiquo_service.rb
abiquo-etk-0.4.33 lib/checks/abiquo_service.rb
abiquo-etk-0.4.32 lib/checks/abiquo_service.rb
abiquo-etk-0.4.29 lib/checks/abiquo_service.rb
abiquo-etk-0.4.25 lib/checks/abiquo_service.rb
abiquo-etk-0.4.24 lib/checks/abiquo_service.rb
abiquo-etk-0.4.23 lib/checks/abiquo_service.rb
abiquo-etk-0.4.22 lib/checks/abiquo_service.rb
abiquo-etk-0.4.20 lib/checks/abiquo_service.rb
abiquo-etk-0.4.19 lib/checks/abiquo_service.rb
abiquo-etk-0.4.18 lib/checks/abiquo_service.rb
abiquo-etk-0.4.17 lib/checks/abiquo_service.rb
abiquo-etk-0.4.16 lib/checks/abiquo_service.rb
abiquo-etk-0.4.15 lib/checks/abiquo_service.rb
abiquo-etk-0.4.14 lib/checks/abiquo_service.rb
abiquo-etk-0.4.13 lib/checks/abiquo_service.rb