i am trying to make a little website with Sinatra, where i want to display SNMP data.
require 'sinatra'
#require 'sinatra/reloader'
require 'snmp'
get'/' do
'Hello World'
SNMP::Manager.open(:host => 'localhost') do |manager|
response = manager.get(["sysDescr.0","sysName.0"])
response.each_varbind do |vb|
puts "#{vb.name.to_s} #{vb.value.to_s} #{vb.value.asn1_type}"
end
end
end
Unfortunately this code outputs the result on the console and not on the Web Page.
I hope you can help me.