Permalink
Browse files

changed /proc/ access to cat -- workaround for http://blade.nagaokaut…

  • Loading branch information...
1 parent 6d1d4f5 commit 4212719f1d471b73aea86c0facb600930a7ee5ff Andre Lewis committed Dec 21, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 cpu_usage/cpu_usage.rb
  2. +1 −1 network_throughput/network_throughput.rb
View
@@ -23,7 +23,7 @@ class CpuStats
attr_accessor :user, :system, :idle, :iowait, :interrupts, :procs_running, :procs_blocked, :time
def self.fetch
- data = File.read("/proc/stat").split(/\n/).collect { |line| line.split }
+ data = %x(cat /proc/stat).split(/\n/).collect { |line| line.split }
cpu_stats = CpuStats.new
if cpu = data.detect { |line| line[0] == 'cpu' }
@@ -11,7 +11,7 @@ class NetworkThroughput < Scout::Plugin
EOS
def build_report
- lines = IO.readlines('/proc/net/dev')[2..-1]
+ lines = %x(cat /proc/net/dev).split("\n")[2..-1]
regex = Regexp.compile(option("interfaces") || /venet|eth/)
interfaces = []
found = false

0 comments on commit 4212719

Please sign in to comment.