lib/zabbix-ruby-client/plugins/rabbitmq.rb in zabbix-ruby-client-0.1.2 vs lib/zabbix-ruby-client/plugins/rabbitmq.rb in zabbix-ruby-client-0.1.3
- old
+ new
@@ -8,17 +8,13 @@
module Rabbitmq
extend self
extend ZabbixRubyClient::PluginBase
def collect(*args)
- host = args[0]
- rabbitmqadmin = args[1]
- login = args[2]
- pass = args[3]
+ host, rabbitmqadmin, login, pass = *args
info = get_info(rabbitmqadmin, login, pass)
back = []
if info
- time = Time.now.to_i
back << "#{host} rabbitmq.version #{time} #{info['rabbitmq_version']}"
back << "#{host} rabbitmq.erlang.version #{time} #{info['erlang_version']}"
%w(ack deliver deliver_get publish redeliver).each do |i|
if info['message_stats'][i]
back << "#{host} rabbitmq.message.#{i} #{time} #{info['message_stats'][i]}"