Discussion:
Trouble adding a MIB
Dan Kegel
2001-01-30 21:56:01 UTC
Permalink
Using any release of net-snmp (4.1.1, 4.1.2, 4.2):

I'm having trouble getting net-snmp to notice a custom mib.

I've created ~/.snmp/snmp.conf containing the line
mibdirs +/home/dank/mymibs

I've copied MIB file DI-SNMP-MIB.txt into that directory.
This file contains a single OBJECT IDENTIFIER.

DI-SNMP-MIB DEFINITIONS ::= BEGIN
disappearing OBJECT IDENTIFIER ::= { enterprises 6257 }
END

Here's what happens when I try it:

$snmptranslate disappearing
disappearing: Unknown Object Identifier (Sub-id not found: mib-2 -> disappearing)
$snmptranslate .iso.3.6.1.private.enterprises.disappearing
.iso.3.6.1.private.enterprises.disappearing: Unknown Object Identifier (Sub-id not found: enterprises -> disappearing)

Running snmptranslate with the -Dall option (which is not properly documented
in the usage message!) yields a long log file which indicates that
it did indeed load DI-SNMP-MIB.txt.

HELP! Why, if it reads my mib file, doesn't it recognize my object identirier?

Thanks,
Dan
p.s. Here's the log file, compressed as a .zip archive.
Dan Kegel
2001-01-30 22:11:21 UTC
Permalink
Post by Dan Kegel
I'm having trouble getting net-snmp to notice a custom mib.
I've created ~/.snmp/snmp.conf containing the line
mibdirs +/home/dank/mymibs
I've copied MIB file DI-SNMP-MIB.txt into that directory.
This file contains a single OBJECT IDENTIFIER.
DI-SNMP-MIB DEFINITIONS ::= BEGIN
disappearing OBJECT IDENTIFIER ::= { enterprises 6257 }
END
$snmptranslate disappearing
disappearing: Unknown Object Identifier (Sub-id not found: mib-2 -> disappearing)
$snmptranslate .iso.3.6.1.private.enterprises.disappearing
.iso.3.6.1.private.enterprises.disappearing: Unknown Object Identifier (Sub-id not found: enterprises -> disappearing)
Running snmptranslate with the -Dall option (which is not properly documented
in the usage message!) yields a long log file which indicates that
it did indeed load DI-SNMP-MIB.txt.
HELP! Why, if it reads my mib file, doesn't it recognize my object identirier?
Update: the commands

$ snmptranslate DI-SNMP-MIB:disappearing
.1.3.6.1.4.1.6257
$ snmptranslate -On DI-SNMP-MIB:disappearing
enterprises.disappearing

work, which is encouraging, but

$ snmptranslate -On enterprises.disappearing
enterprises.disappearing: Unknown Object Identifier (Sub-id not found: mib-2 -> enterprises)
$ snmptranslate -m DI-SNMP-MIB -On enterprises.disappearing
enterprises.disappearing: Unknown Object Identifier (Sub-id not found: mib-2 -> enterprises)

don't. Guess I'm confused. Can anyone enlighten me?

BTW, this is stock net-snmp 4.2; I haven't compiled in any modules nor
given it any special options when configuring.

Thanks,
Dan
Dan Kegel
2001-01-30 23:12:37 UTC
Permalink
Post by Dan Kegel
Post by Dan Kegel
I'm having trouble getting net-snmp to notice a custom mib.
I've created ~/.snmp/snmp.conf containing the line
mibdirs +/home/dank/mymibs
I've copied MIB file DI-SNMP-MIB.txt into that directory.
This file contains a single OBJECT IDENTIFIER.
DI-SNMP-MIB DEFINITIONS ::= BEGIN
disappearing OBJECT IDENTIFIER ::= { enterprises 6257 }
END
$ snmptranslate disappearing
disappearing: Unknown Object Identifier (Sub-id not found: mib-2 -> disappearing)
Running snmptranslate with the -Dall option (which is not properly documented
in the usage message!) yields a long log file which indicates that
it did indeed load DI-SNMP-MIB.txt.
HELP! Why, if it reads my mib file, doesn't it recognize my object identirier?
Update: the commands
$ snmptranslate DI-SNMP-MIB:disappearing
.1.3.6.1.4.1.6257
$ snmptranslate -On DI-SNMP-MIB:disappearing
enterprises.disappearing
work, which is encouraging...
One final clue:

$ snmptranslate -PwW -Td DI-SNMP-MIB:disappearing

produces (among others) the warning

Unlinked OID in DI-SNMP-MIB: disappearing ::= { enterprises 6257 }

Oh, ok. Maybe I forgot to define 'enterprises'. Sure enough,
adding an import for 'enterprises' to the MIB

DI-SNMP-MIB DEFINITIONS ::= BEGIN
IMPORTS enterprises FROM SNMPv2-SMI;
disappearing OBJECT IDENTIFIER ::= { enterprises 6257 }
END

gets rid of that warning. Still,

$ snmptranslate disappearing

fails, even if I specify -m DI-SNMP-MIB. Help!

- Dan
Dan Kegel
2001-01-31 00:01:28 UTC
Permalink
This has to be the most noise I've generated on a mailing list for a long
time. Anyway, here's the scoop:

For some reason, you really do have to recompile net-snmp to access
a new mib, even though it *looks* like it can add new mibs at runtime.
After I did
$ make clean
$ ./configure --with-mibs=IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB:DI-SNMP-MIB
$ make
# make install

suddenly
$ snmptranslate -IR disappearing
.1.3.6.1.4.1.6257

started working.

As a check, I reconfigured without the "--with-mibs" option, rebuilt, and reinstalled,
and it reverted back to its broken ways.

Thanks for listening, sorry for the noise, and I hope this helps a couple other newbies.
- Dan
Post by Dan Kegel
Post by Dan Kegel
Post by Dan Kegel
I'm having trouble getting net-snmp to notice a custom mib.
I've created ~/.snmp/snmp.conf containing the line
mibdirs +/home/dank/mymibs
I've copied MIB file DI-SNMP-MIB.txt into that directory.
This file contains a single OBJECT IDENTIFIER.
DI-SNMP-MIB DEFINITIONS ::= BEGIN
disappearing OBJECT IDENTIFIER ::= { enterprises 6257 }
END
$ snmptranslate disappearing
disappearing: Unknown Object Identifier (Sub-id not found: mib-2 -> disappearing)
Running snmptranslate with the -Dall option (which is not properly documented
in the usage message!) yields a long log file which indicates that
it did indeed load DI-SNMP-MIB.txt.
HELP! Why, if it reads my mib file, doesn't it recognize my object identirier?
Update: the commands
$ snmptranslate DI-SNMP-MIB:disappearing
.1.3.6.1.4.1.6257
$ snmptranslate -On DI-SNMP-MIB:disappearing
enterprises.disappearing
work, which is encouraging...
$ snmptranslate -PwW -Td DI-SNMP-MIB:disappearing
produces (among others) the warning
Unlinked OID in DI-SNMP-MIB: disappearing ::= { enterprises 6257 }
Oh, ok. Maybe I forgot to define 'enterprises'. Sure enough,
adding an import for 'enterprises' to the MIB
DI-SNMP-MIB DEFINITIONS ::= BEGIN
IMPORTS enterprises FROM SNMPv2-SMI;
disappearing OBJECT IDENTIFIER ::= { enterprises 6257 }
END
gets rid of that warning. Still,
$ snmptranslate disappearing
fails, even if I specify -m DI-SNMP-MIB. Help!
Dimitrios Andrikopoulos
2001-01-31 09:56:16 UTC
Permalink
Dear Dan,

I tried the option "--with-mibs" as I had similar problems. Everything
was ok until I tried to re-install the Perl/SNMP Module. Have you tried that?
If you try that you would get at the "make test" time the below:

.
.
.
t/mib...............NOK 28Use of uninitialized value in array dereference at t/mib.t line 180.

Use of uninitialized value in numeric eq (==) at t/mib.t line 180.
t/mib...............NOK 29Use of uninitialized value in numeric eq (==) at t/mib.t line 181.
t/mib...............ok 30/33Use of uninitialized value in numeric eq (==) at t/mib.t line 182.

t/mib...............ok 31/33Use of uninitialized value in numeric eq (==) at t/mib.t line 183.

t/mib...............NOK 32Use of uninitialized value in numeric eq (==) at t/mib.t line 184.
t/mib...............NOK 33FAILED tests 27-29, 32-33
Failed 5/33 tests, 84.85% okay
.
.
.

D.A
Post by Dan Kegel
This has to be the most noise I've generated on a mailing list for a long
For some reason, you really do have to recompile net-snmp to access
a new mib, even though it *looks* like it can add new mibs at runtime.
After I did
$ make clean
$ ./configure --with-mibs=IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB:DI-SNMP-MIB
$ make
# make install
suddenly
$ snmptranslate -IR disappearing
.1.3.6.1.4.1.6257
started working.
As a check, I reconfigured without the "--with-mibs" option, rebuilt, and reinstalled,
and it reverted back to its broken ways.
Thanks for listening, sorry for the noise, and I hope this helps a couple other newbies.
- Dan
Post by Dan Kegel
Post by Dan Kegel
Post by Dan Kegel
I'm having trouble getting net-snmp to notice a custom mib.
I've created ~/.snmp/snmp.conf containing the line
mibdirs +/home/dank/mymibs
I've copied MIB file DI-SNMP-MIB.txt into that directory.
This file contains a single OBJECT IDENTIFIER.
DI-SNMP-MIB DEFINITIONS ::= BEGIN
disappearing OBJECT IDENTIFIER ::= { enterprises 6257 }
END
$ snmptranslate disappearing
disappearing: Unknown Object Identifier (Sub-id not found: mib-2 -> disappearing)
Running snmptranslate with the -Dall option (which is not properly documented
in the usage message!) yields a long log file which indicates that
it did indeed load DI-SNMP-MIB.txt.
HELP! Why, if it reads my mib file, doesn't it recognize my object identirier?
Update: the commands
$ snmptranslate DI-SNMP-MIB:disappearing
.1.3.6.1.4.1.6257
$ snmptranslate -On DI-SNMP-MIB:disappearing
enterprises.disappearing
work, which is encouraging...
$ snmptranslate -PwW -Td DI-SNMP-MIB:disappearing
produces (among others) the warning
Unlinked OID in DI-SNMP-MIB: disappearing ::= { enterprises 6257 }
Oh, ok. Maybe I forgot to define 'enterprises'. Sure enough,
adding an import for 'enterprises' to the MIB
DI-SNMP-MIB DEFINITIONS ::= BEGIN
IMPORTS enterprises FROM SNMPv2-SMI;
disappearing OBJECT IDENTIFIER ::= { enterprises 6257 }
END
gets rid of that warning. Still,
$ snmptranslate disappearing
fails, even if I specify -m DI-SNMP-MIB. Help!
_______________________________________________
Net-snmp-users mailing list
http://lists.sourceforge.net/lists/listinfo/net-snmp-users
Bo Xie
2001-01-31 03:45:57 UTC
Permalink
Hi Dan and all,

Thanks for the posting. I am having similar problem here.

I tried 4.2 on solaris, this is what I got

dratini root mibs### snmptranslate -n system
.1.3.6.1.2.1.1
dratini root mibs### snmptranslate -n system.sysDescr
sub-identifier not found: sysDescr
dratini root mibs### snmptranslate
usage: snmptranslate [-n] [-d] object-identifier

The configure option I had is:

./configure --prefix=/opt/ucd-snmp/local --enable-reentrant --with-mib-modules="agentx"

Question #1: why even sysDescr is not found?
Question #2: what need to be done to have option like -PwW -Td in snmptranslate? I tried
on -n worked, not even -d.

Thanks,
-Bo
Post by Dan Kegel
Post by Dan Kegel
Post by Dan Kegel
I'm having trouble getting net-snmp to notice a custom mib.
I've created ~/.snmp/snmp.conf containing the line
mibdirs +/home/dank/mymibs
I've copied MIB file DI-SNMP-MIB.txt into that directory.
This file contains a single OBJECT IDENTIFIER.
DI-SNMP-MIB DEFINITIONS ::= BEGIN
disappearing OBJECT IDENTIFIER ::= { enterprises 6257 }
END
$ snmptranslate disappearing
disappearing: Unknown Object Identifier (Sub-id not found: mib-2 -> disappearing)
Running snmptranslate with the -Dall option (which is not properly documented
in the usage message!) yields a long log file which indicates that
it did indeed load DI-SNMP-MIB.txt.
HELP! Why, if it reads my mib file, doesn't it recognize my object identirier?
Update: the commands
$ snmptranslate DI-SNMP-MIB:disappearing
.1.3.6.1.4.1.6257
$ snmptranslate -On DI-SNMP-MIB:disappearing
enterprises.disappearing
work, which is encouraging...
$ snmptranslate -PwW -Td DI-SNMP-MIB:disappearing
produces (among others) the warning
Unlinked OID in DI-SNMP-MIB: disappearing ::= { enterprises 6257 }
Oh, ok. Maybe I forgot to define 'enterprises'. Sure enough,
adding an import for 'enterprises' to the MIB
DI-SNMP-MIB DEFINITIONS ::= BEGIN
IMPORTS enterprises FROM SNMPv2-SMI;
disappearing OBJECT IDENTIFIER ::= { enterprises 6257 }
END
gets rid of that warning. Still,
$ snmptranslate disappearing
fails, even if I specify -m DI-SNMP-MIB. Help!
- Dan
_______________________________________________
Net-snmp-users mailing list
http://lists.sourceforge.net/lists/listinfo/net-snmp-users
n***@baggesen.com
2001-01-31 07:01:12 UTC
Permalink
Post by Dan Kegel
I'm having trouble getting net-snmp to notice a custom mib.
I've created ~/.snmp/snmp.conf containing the line
mibdirs +/home/dank/mymibs
I've copied MIB file DI-SNMP-MIB.txt into that directory.
This file contains a single OBJECT IDENTIFIER.
DI-SNMP-MIB DEFINITIONS ::= BEGIN
disappearing OBJECT IDENTIFIER ::= { enterprises 6257 }
END
$snmptranslate disappearing
disappearing: Unknown Object Identifier (Sub-id not found: mib-2 ->
disappearing)

But you didn't tell the tools to LOAD the mib. Try one of these:

snmptranslate -m DI-SNMP-MIB disappearing

snmptranslate DI-SNMP-MIB::disappearing

or add "mibs +DI-SNMP-MIB" to snmp.conf

Then you will see some errors, because your mib needs to

IMPORT enterprises FROM SNMPv2-SMI;
Post by Dan Kegel
Running snmptranslate with the -Dall option (which is not properly documented
in the usage message!) yields a long log file which indicates that
it did indeed load DI-SNMP-MIB.txt.
Well, -Dall is certainly not for public consumption ...

The log tells you that it noticed that the file DI-SNMP-MIB.txt contains the mib
named DI-SNMP-MIB, but it never loaded that mib, because noone asked for it.

/Niels
--
Get your ***@lastname email for FREE at http://Nameplanet.com/?su
Dave Shield
2001-01-31 10:34:30 UTC
Permalink
Post by Dan Kegel
For some reason, you really do have to recompile net-snmp to access
a new mib, even though it *looks* like it can add new mibs at runtime.
No - that's not true:

bash$ snmptranslate rmon
Invalid object identifier: rmon
bash$ snmptranslate -IR rmon
Unknown object identifier: rmon
bash$ snmptranslate RMON-MIB::rmon
.1.3.6.1.2.1.16
bash$ snmptranslate -m RMON-MIB rmon
.1.3.6.1.2.1.16

Your problem seems to be slightly different:

bash$ snmptranslate -IR disappearing
Unknown object identifier: disappearing
bash$ snmptranslate DI-SNMP-MIB::disappearing
.1.3.6.1.4.1.6257
bash$ snmptranslate -m DI-SNMP-MIB disappearing
Invalid object identifier: disappearing
bash$ snmptranslate -IR -m DI-SNMP-MIB disappearing
.1.3.6.1.4.1.6257

Note that snmptranslate (in contrast to the other tools) does not
perform "random access" lookups by default. You need to specify
this explicitly (-IR).

So the command "snmptranslate -m DI-SNMP-MIB disappearing"
successfully loads the DI-SNMP-MIB file, but cannot find the
object
.iso.org.dod.internet.mgmt.mib-2.disappearing

which is quite correct (if very confusing!)
Post by Dan Kegel
As a check, I reconfigured without the "--with-mibs" option, rebuilt,
and reinstalled, and it reverted back to its broken ways.
But did you run

snmptranslate -m DI-SNMP-MIB disappearing
or
snmptranslate -IR -m DI-SNMP-MIB disappearing
?

Dave
Dave Shield
2001-01-31 10:40:04 UTC
Permalink
Post by Bo Xie
I tried 4.2 on solaris, this is what I got
dratini root mibs### snmptranslate -n system
.1.3.6.1.2.1.1
$ snmptranslate -n system [4.2]
snmptranslate: illegal option -- n
$ snmptranslate -n system [4.1.1]
Warning: -n option is deprecated - use -On
system
Post by Bo Xie
dratini root mibs### snmptranslate -n system.sysDescr
sub-identifier not found: sysDescr
$ snmptranslate -On system.sysDescr
system.sysDescr
Post by Bo Xie
dratini root mibs### snmptranslate
usage: snmptranslate [-n] [-d] object-identifier
$ snmptranslate
usage: snmptranslate [options] [<objectID>]

-h Print this help message.
-V Print snmptranslate version then exit.
-m <MIBS> use MIBS list instead of the default mib list.
-D enable snmplib debugging messages
-M <MIBDIRS> use MIBDIRS as the location to look for mibs.
-w <width> width of tree and detail print output
<etc, etc>


Are you *sure* you're using the {UCD,Net}-SNMP version of 'snmptranslate' ?

What does
snmptranslate -V
give?

Dave

Loading...