Re: [Hampshire] Deciding SNMP MIB files in Linux

Top Page
Author: Chris Smith
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Deciding SNMP MIB files in Linux

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x57d09100.hantslug.org.uk.17577': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Fri Sep 14 09:38:17 2012 BST
gpg: using DSA key 11BEF6408586B4B2
gpg: Can't check signature: No public key
On 13/09/2012 08:23, Paul Stimpson wrote:
>
> I'm not finding the snmptranslate man page very easy going. it looks
> like I need to find out how to indicate to it which file is the first
> I want it to parse.


No, not at all. The purpose of snmptranslate is simply to translate a
numeric OID into a textual name -- effectively doing a reverse lookup.
It is useful because it uses the same core library as the rest of the
snmp tools, so can be used to verify that your MIB is valid and is being
used.

The snmp tools need to know: a) where to look for MIB files; and b)
which MIBs you specifically want to load. You can give this information
on the commandline using the -M and -m options, respectively, but I
prefer to do it using the environment using the MIBDIRS and MIBS
variables, respectively.

Bear in mind that MIBDIRS overrides the compiled-in default location, so
if you use it you need to specify the full path list. As an example,
using a Debian distribution:

$ export MIBDIRS=/usr/share/snmp/mibs:/home/cjs94/MIBS
$ export MIBS=+ALL

$ snmptranslate 1.3.6.1.4.1
SNMPv2-SMI::enterprises

The above will load all MIB files found in the path list and use them to
map numeric OIDs to names and vice-versa.

Once snmptranslate works for you, the other tools will work too.

Also bear in mind that the MIB files usually specify more than just OID
mappings. They also specify data formats and the semantics of the data,
and snmptranslate will translate those too. If an integer value of 1
for a given OID means 'Online' and that has been specified in the MIB,
snmptranslate will translate that back and forth too.

I recommend looking at net-snmp.org (the home of the snmp* tools) and
the associated mailing list. There's a wealth of information there.

Regards,
Chris
--
Chris Smith <cjs94@???>

--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------