1

I've tried to open several MIB files in tkmib without success. For example:

$ sudo apt-get install tkmib
$ wget http://www.mibsearch.com/vendors/Compaq/download/CPQHLTH-MIB
$ tkmib CPQHLTH-MIB

Click "walk", then you should get an error message like this:

setting opts
getaddrinfo: CPQHLTH-MIB No address associated with hostname
error:snmp_new_session: Couldn't open SNMP session at /usr/lib/perl5/SNMP.pm line 475.
unable to create session at /usr/lib/perl5/SNMP.pm line 547.
Tk::Error: Can't call method "getnext" on unblessed reference at /usr/bin/tkmib line 506.
 main::snmpwalk at /usr/bin/tkmib line 506
 Tk callback for .frame5.button2
 Tk::__ANON__ at /usr/lib/perl5/Tk.pm line 250
 Tk::Button::butUp at /usr/lib/perl5/Tk/Button.pm line 175
 <ButtonRelease-1>
 (command bound to event)

As I'm completely new to SNMP and MIB files, and man tkmib is sparse to say the least, what do I actually need to do to be able to work with this file?

l0b0
  • 8,819

3 Answers3

3

Install snmp-mibs-downloader:

sudo apt-get install snmp-mibs-downloader

It install a lot of MIBS in /var/lib/mibs/ietf

Then load with File > Load

anon
  • 46
  • 2
0

What are you trying to do?

The command line argument that you gave tkmib appears to have been used as a hostname.

Run it without any command-line argument, then use File->Load a New Mib File, and choose your MIB. But you'll probably run into problems because the base MIBs aren't installed.

You'll probably want to change the hostname (it will default to "localhost") that appears about 2/3 down the screen.

You didn't mention which Ubuntu version you're using, but they don't appear to ship in any package in 12.04. In 10.04, the base MIBs are part of the libsnmp-base package. If you're running a version that doesn't provide the base MIBs as part of libsnmp-base, I'd suggest manually downloading the MIBs and putting them in one of these directories:

  • $HOME/.snmp/mibs
  • /usr/share/mibs/site
  • /usr/share/snmp/mibs
  • /usr/share/mibs/iana
  • /usr/share/mibs/ietf
  • /usr/share/mibs/netsnmp

since those directories are (apparently) used as the search path by tkmib (and other software).

bstpierre
  • 2,086
0

The tkmib package appears to have been 'broken' for some time now.

Take a look at the very old bug No values from OIDs with tkmib on the Debian mailing list from 2010. The default net-snmp version that shipped with Ubuntu has been 5.4.3 and does work as expected with other SNMP-dependant applications (e.g. Cacti) but not with tkmib.

I recently compiled a new version of net-snmp (version 5.7.2) following these instructions and was able to get some minimal use out of tkmib.

After compilation, I was able to get some values returned by tkmib. However the application interface does not act as one might expect. That is, when issuing a get query on a MIB instance(say querying the sysDesc MIB, for example), tkmib returns a value of NOSUCHINSTANCE. However, while issuing a getnext query upon the same instance returns the actual expected value.

I highly recommend using another MIB browser, such as snmpb. The functionality and interface of SnmpB are far superior for obtaining accurate SNMP values, in my opinion, compared to tkmib.

The MIB browsing, polling, as well as setting MIBS is far less painful than using tkmib

If you are set on using tkmib, keep in mind that you will also need to manually create a ~/.snmp directory to save any of your changed values between sessions.

If you are interested in taking snmpb for a spin, you can download the .deb file here, and install it with sudo dpkg -i snmpb_0.8_i386.deb

Best of luck.

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83