ruby-snmp annoying problem :(

M

Marcin Jurczuk

Simple script (Should set Integer=1 into device)

#!/usr/local/bin/ruby
require 'rubygems'
require 'snmp'
include SNMP

manager = Manager.new:)Host => '10.20.9.53')
varbind = VarBind.new("1.3.6.1.2.1.69.1.1.3.0", Integer(1))
manager.set(varbind)
manager.close

Result:
warbird soaftp # ./lo.rb
[cut crap]
/usr/local/lib/ruby/gems/1.8/gems/snmp-0.5.1/lib/snmp/manager.rb:264:in
`set': host 10.20.9.53 not responding (SNMP::RequestTimeout)
from ./lo.rb:8

This looks like lie to me :
warbird soaftp # ping 10.20.9.53
10.20.9.53 is alive
warbird soaftp #
Using snmpset from net-snmp package I'm able to set this value..

Get is OK but I'm not able to create working version of set :(

Help please :)
 
Y

Yuri Kozlov

imple script (Should set Integer=1 into device)
#!/usr/local/bin/ruby
require 'rubygems'
require 'snmp'
include SNMP

manager = Manager.new:)Host => '10.20.9.53')
varbind = VarBind.new("1.3.6.1.2.1.69.1.1.3.0", Integer(1))
manager.set(varbind)
manager.close

Result:
warbird soaftp # ./lo.rb
[cut crap]
/usr/local/lib/ruby/gems/1.8/gems/snmp-0.5.1/lib/snmp/manager.rb:264:in
`set': host 10.20.9.53 not responding (SNMP::RequestTimeout)
from ./lo.rb:8

Try this:
manager = SNMP::Manager.new:)Host => '10.20.9.53', :Version => :SNMPv1,
:Community => !!you community here!!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top