Dirtbag's Blog

Why wont snmpget work anymore?!

[ link: snmpbroke | tags: linux snmp | updated: Fri, 17 Apr 2020 12:06:22 -0400 ]

So I have been using the following little script for quite some time to test snmpd working on some remote server. After a recent Linux package update though, it stopped working. :(

I have been using the following script (testsnmp) for quite a while to test snmp on remote servers:

snmpget -v1 -c communitystring  sysName.0

and It used to work until recently. I started getting the following error.

[jason@zim ~/bin]$testsnmp someserver 
sysName.0: Unknown Object Identifier (Sub-id not found: (top) -> sysName)
[jason@zim ~/bin]$

I finally figured out that the MIBS are now not allowed to be distrubted with the OS by default. You have to jump through a few hoops to get it to work. The following is what I had to do to make it work on Linux Mint (ubuntu). Your mileage may vary.

  1. apt-get install snmp-mibs-downloader
  2. edit the /etc/snmp/snmp.conf file and comment out the line that has "mibs :" in it. It was the last line for me. It should look like this afterwards.
# As the snmp packages come without MIB files due to license reasons, loading
# of MIBs is disabled by default. If you added the MIBs you can reenable
# loading them by commenting out the following line.
#mibs :

and now my script works again!!

-db

Like this article? Buy me a beer!