Class: Spacewalk::StatusReport
- Inherits:
-
Object
- Object
- Spacewalk::StatusReport
- Defined in:
- lib/spacewalk/status_report.rb
Class Method Summary collapse
Class Method Details
.status ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/spacewalk/status_report.rb', line 3 def self.status status = {} # Return a 5-tuple containing information identifying the current operating system. # The tuple contains 5 strings: (sysname, nodename, release, version, machine). # (uname -s, uname -n, uname -r, uname -v, uname -m) status["uname"] = [`uname -s`.chomp, `uname -n`.chomp, `uname -r`.chomp, `uname -v`.chomp, `uname -m`.chomp] begin File.open("/proc/uptime") do |f| status["uptime"] = f.read.split(" ").map{|v| v.to_i} end rescue nil end # puts status.inspect status end |