Sha256: 7b4e178c8e6429d69b7042f82df49d47436481ca94edcc36ba4fd08e99449c43

Contents?: true

Size: 753 Bytes

Versions: 51

Compression:

Stored size: 753 Bytes

Contents

require 'open3'
puts "starting"
command = "foreman-sosreport " +
					"--batch " + 
					"-o rpm,libvirt,general,networking,hardware,process,yum,filesys,devicemapper" +
					",kernel,apache,memory "+
					"-k general.all_logs=True " +
					"-k apache.log=True " +
					"-k rpm.rpmva=off"
puts "running command"+ command
#system command
puts "done runnng "

puts "run with opens3"

Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
  pid = wait_thr.pid # pid of the started process.
  #puts stdout.readlines
  report_location = ''
  if wait_thr.value == 0 
  	stdout.readlines.each do |line|
  		if line.include? "tar.xz"
  			report_location = line
  			break
  		end
  	end
  else
  	puts "sos report failed"
  end
  puts report_location
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
redhat_access-2.9.1 test/sos-report-test.rb
redhat_access-2.8.1 test/sos-report-test.rb
redhat_access-2.2.20 test/sos-report-test.rb
redhat_access-2.2.19 test/sos-report-test.rb
redhat_access-2.2.18 test/sos-report-test.rb
redhat_access-2.2.17 test/sos-report-test.rb
redhat_access-2.2.16 test/sos-report-test.rb
redhat_access-2.2.15 test/sos-report-test.rb
redhat_access-2.2.14 test/sos-report-test.rb
redhat_access-2.2.13 test/sos-report-test.rb
redhat_access-2.2.12 test/sos-report-test.rb
redhat_access-2.2.11 test/sos-report-test.rb
redhat_access-2.2.10 test/sos-report-test.rb
redhat_access-2.2.9 test/sos-report-test.rb
redhat_access-2.2.8 test/sos-report-test.rb
redhat_access-2.2.7 test/sos-report-test.rb
redhat_access-2.1.10 test/sos-report-test.rb
redhat_access-2.0.17 test/sos-report-test.rb
redhat_access-2.0.16 test/sos-report-test.rb
redhat_access-2.1.9 test/sos-report-test.rb