Snmp with s2nmp or rubyonrails


Hi all,

I’m using Ruby about 3-4 mounts. Now, i want to make a project about
network devices with SNMP.

But, until this time; i haven’t used rubyonrails yet.

Yesterday (i hope) i’ve installed rubyonrails. And i made some steps
like that:

rails /home/student/new_directory

and i copy a script in it like:

require ‘snmp’

ifTable_columns =
[“ifIndex”, “ifDescr”, “ifInOctets”, “ifOutOctets”] => ‘localhost’) do |manager|
manager.walk(ifTable_columns) do |row|
row.each { |vb| print “\t#{vb.value}” }

But it tells me;
`require’: no such file to load – snmp (LoadError)

I tried to fix this but i couldn’t do anything.

So i gave up to do it with rubyonrails; and installed s2nmp

This time; i tried to run this script like: #ruby example.rb
(i couldn’t find an ip address to make excercises so i tried to use my
adsl router:

Usage: ruby getsysdsc.rb

require ‘socket’
require ‘s2nmp’

if sts then
p s.vars
print “TIMEOUT.”

It tells me:

/usr/lib/ruby/1.8/s2nmp.rb:267:in recv': Connection refused - recvfrom(2) (Errno::ECONNREFUSED) from /usr/lib/ruby/1.8/s2nmp.rb:267:inget’
from example.rb:10

Can you give me any ideas or advices? Plus; i haven’t decide to make it
with s2nmp or rubyonrails.

Best Regards,

Esravan Rolda.