lib/zabbix-ruby-client/plugins/cpu.rb in zabbix-ruby-client-0.0.7 vs lib/zabbix-ruby-client/plugins/cpu.rb in zabbix-ruby-client-0.0.8
- old
+ new
@@ -1,6 +1,8 @@
-# for more info check http://www.linuxhowtos.org/System/procstat.htm
+# for more info check
+# http://www.linuxhowtos.org/System/procstat.htm
+# http://juliano.info/en/Blog:Memory_Leak/Understanding_the_Linux_load_average
class ZabbixRubyClient
module Plugins
module Cpu
extend self
@@ -13,10 +15,10 @@
_, user, nice, sys, idle, wait, irq, soft, guest, steal = cpuinfo.split(/\s+/).map(&:to_i)
else
logger.warn "Oh you don't have a /proc ?"
return []
end
- used = user + nice + sys + wait + irq + soft + steal + guest
+ used = user + nice + sys
total = used + idle
time = Time.now.to_i
back = []
back << "#{host} cpu[user] #{time} #{user}"