lib/zabbix-ruby-client.rb in zabbix-ruby-client-0.0.6 vs lib/zabbix-ruby-client.rb in zabbix-ruby-client-0.0.7
- old
+ new
@@ -74,20 +74,21 @@
end
end
end
def merge_discover
+ time = Time.now.to_i
@data = @discover.reduce([]) do |a,(k,v)|
- a << "#{@config['host']} #{k} { \"data\": [ #{v.join(', ')} ] }"
+ a << "#{@config['host']} #{k} #{time} { \"data\": [ #{v.join(', ')} ] }"
a
end + @data
end
def upload
merge_discover
store
begin
- res = `#{@config['zabbix']['sender']} -z #{@config['zabbix']['host']} -i #{datafile}`
+ res = `#{@config['zabbix']['sender']} -z #{@config['zabbix']['host']} -T -i #{datafile}`
rescue Exception => e
logger.error "Sending failed."
logger.error e.message
end
end