lib/zabbix-ruby-client/plugins/mysql.rb in zabbix-ruby-client-0.1.2 vs lib/zabbix-ruby-client/plugins/mysql.rb in zabbix-ruby-client-0.1.3
- old
+ new
@@ -2,10 +2,11 @@
module ZabbixRubyClient
module Plugins
module Mysql
extend self
+ extend ZabbixRubyClient::PluginBase
def collect(*args)
host = args[0]
mysqlargs = args[1]
mysqlstatus = `mysqladmin #{mysqlargs} extended-status`
@@ -14,10 +15,9 @@
else
Log.warn "The connection failed."
return []
end
- time = Time.now.to_i
back = []
back << "#{host} mysql.status[Aborted_clients] #{time} #{status["Aborted_clients"]}"
back << "#{host} mysql.status[Aborted_connects] #{time} #{status["Aborted_connects"]}"
back << "#{host} mysql.status[Bytes_received] #{time} #{status["Bytes_received"]}"
back << "#{host} mysql.status[Bytes_sent] #{time} #{status["Bytes_sent"]}"