How to use a MIB file

11,004

Solution 1

See here: https://web.archive.org/web/20090323043038/http://www.sifizm.com/2009/02/19/using-snmpget-or-snmpwalk-and-a-vendor-mib-file/

First, copy your .mib file into the directory where your script is located.

Then use snmpget in the following format:

snmpget [address] -c [community string] -v 1 -m [mib name] [object to scan]

Then use snmpwalk in the following format:

snmpwalk [address] -c [community string] -v 1 -m [mib name] [object to scan]

On most Linux systems, the MIB files should go to /usr/share/snmp/mibs or probably /usr/local/share/snmp/mibs.

Solution 2

Put STRANGE-NEW-MIB.txt in the directory where all your other MIBs are stored (possibly /usr/share/snmp/mibs , but it may vary with distro, mine is Fedora 14), then do

snmpwalk -v 1 -c public -m +STRANGE-NEW-MIB 1.2.3.4

where you replace public with the real RO community strong, STRANGE-NEW-MIB is the name of your new MIB without the .txt suffix (if memory serves), and 1.2.3.4 is the IP address of your switch.

Share:
11,004

Related videos on Youtube

Wegged
Author by

Wegged

Sysadmin of a small network ~30pc's 2 servers. I like IT, and i'm doing this as an extra responsability at my job. Keeping IT in the company works great for us :)

Updated on September 17, 2022

Comments

  • Wegged
    Wegged over 1 year

    I have a HP 2626 switch and want to monitor it by SNMP. how can i use the MIB file.
    Any starting points on how to understand it ?
    using snmpwalk to get the data in a *nix machine and output it in a .txt file

    How can i get a list of all the connected mac-addresses and coresponding ports by snmp from a HP Procurve 2626 ? And then how can i get current port utilization by SNMP?

    • Admin
      Admin over 13 years
      Check the MIB perhaps?
    • Admin
      Admin over 13 years
      MIB but i don't know how to use it. any hints ?
    • Admin
      Admin over 13 years
      What tool, on what platform, do you intend to use to do this? At least gives us some clue of the platform you want to do it from. Linux, perhaps?
    • Admin
      Admin over 13 years
      Linux, i am using snmpwalk, but this returns me all the OID's from the device and i can not make sense of all the data
  • eater
    eater over 13 years
    You can also export MIBS=ALL so snmpwalk will read every MIB in /usr/share/snmp/mibs without having to list them all on the command line. Useful since HP probably gave you +/-8 billion MIB files.
  • Wegged
    Wegged over 13 years
    yea' i have like 2 dozen files and will take ages to read them out :))
  • bk201
    bk201 over 3 years
    The link is dead.