Skip to content

Instantly share code, notes, and snippets.

@domofactor
Created March 12, 2015 00:12
Show Gist options
  • Save domofactor/fed026cf47a1448cc106 to your computer and use it in GitHub Desktop.
Save domofactor/fed026cf47a1448cc106 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
iostat=`iostat -xdm 30 2| grep -B1 sda| tail -2`.split("\n")
iostat_keys=iostat[0].split("\s")
iostat_values=iostat[1].split("\s")
iostat_hash=Hash[iostat_keys.zip(iostat_values)]
iostat_hash.each do |k,v|
sender=`zabbix_sender -v -c /etc/zabbix/zabbix_agentd.conf -k "iostat-#{k}" -o "#{v}"`
## DEBUG ##
#puts "iostat-#{k} = #{v}"
#puts sender
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment