NoMethodError for SNMP::MIB.oid (newby!)

T

Toby Rodwell

I'm using the snmp library for Ruby. My programs are very basic and are
developments of the example scripts in the documentation. At the moment
I'm trying to get an OID and thought that to do that I could use
SNMP::MIB.oid(<value>)
but I get a 'NoMethodError' even though the oid method clearly does
exist. What gives? Thanks in advance!

PS What I'm actually try to do is to give "ifDescr" and get
1.3.6.1.2.1.2.2.1.2 in return.
 
T

Toby Rodwell

"Physician, [part] heal thyself"

Well, the reason why I was getting the NoMethodError was because I was
trying to use it as a class method whereas it is in fact an instance
method. So what I needed was something like:

newMib = SNMP::MIB.new
newMib.load_module("IF-MIB")

wantedOid = newMib.oid("ifIndex")

... but there's got to be quicker way of doing that surely!
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top