Greetz,
I know almost nothing about Ruby, could someone maybe assist by advising how to print the below
fields but for each value in each column concatenate the value with the CIM field (loosely named for now), like interface="ifDescr" in="ifInOctets" out="ifOutOctets"?
Thank you.
require 'rubygems'
require 'snmp'
ifTable_columns = ["ifDescr", "ifInOctets", "ifOutOctets"]
SNMP::Manager.open(:host => '10.0.0.10', :community => 'public') do |manager|
manager.walk(ifTable_columns) do |row|
row.each { |vb| print "\s#{vb.value}" }
puts
end
end
Hi - If you are new to ruby, our upcoming Ruby SDK release might be able to help you interface with Splunk. We can give you pre-release access now. Just send your GitHub ID to: devinfo@splunk.com
I see you figured it out, but the Ruby SDK for Splunk wouldn't be much help here. It's a core Ruby question, and not really something involving Splunk. There are a lot more Rubyists actively answering questions on Stackoverflow, so you'll probably get faster responses there.
require 'rubygems'
require 'snmp'
SNMP::Manager.open(:host => '10.0.0.10', :community => 'public') do |manager|
manager.walk(["ifDescr", "ifInOctets", "ifOutOctets"]) do |descr, inoctets, outoctets|
puts "src_int=#{descr.value} bytes_in=#{inoctets.value} bytes_out=#{outoctets.value}"
end
end
Hi - If you are new to ruby, our upcoming Ruby SDK release might be able to help you interface with Splunk. We can give you pre-release access now. Just send your GitHub ID to: devinfo@splunk.com
Wow! Thank you.