Module: ZabbixRubyClient::Plugins::Cpu

Extended by:
ZabbixRubyClient::PluginBase, Cpu
Included in:
Cpu
Defined in:
lib/zabbix-ruby-client/plugins/cpu.rb

Instance Method Summary collapse

Methods included from ZabbixRubyClient::PluginBase

getline, getlines, httprequest, perform

Instance Method Details

#collect(*args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/zabbix-ruby-client/plugins/cpu.rb', line 12

def collect(*args)
  host = args[0]
  info = get_info
  back = []
  if info
    time = Time.now.to_i
    info.each do |k,v|
      back << "#{host} cpu[#{k}] #{time} #{v}"
    end
  end
  back
end