Leveraging SNMP is often a pain when appropriate MIB files (Management Information Base) are missing – e.g. because the manufacturer did not document them or only offer them at fee. When utilizing a Perl program recently, I stumbled upon the following issue:
Cannot find module (SNMPv2-SMI):
After ensuring that missing Perl SNMP packages are not the reason for this error, I discovered the “snmp-mibs-downloader” package. This utility downloads missing SNMP MIBs and places them in the appropriate folders. The package is part of the non-free repository that might be needed to enabled first:
# vi /etc/apt/sources.list ... deb http://deb.debian.org/debian stretch main contrib non-free deb-src http://deb.debian.org/debian stretch main contrib non-free deb http://security.debian.org/debian-security/ stretch/updates main contrib non-free deb-src http://security.debian.org/debian-security/ stretch/updates main contrib non-free deb http://deb.debian.org/debian stretch-updates main contrib non-free deb-src http://deb.debian.org/debian stretch-updates main contrib non-free ESC ZZ # apt-get update
Downloading the MIBs is taking place right after the package installation – but it is also possible to start this process manually by starting the download-mibs command:
# apt-get install snmp-mibs-downloader ... Downloading documents and extracting MIB files. This will take some minutes. In case this process fails, it can always be repeated later by executing /usr/bin/download-mibs again. RFC1155-SMI: 119 lines. RFC1213-MIB: 2613 lines. ...
Afterwards, the Perl program was working fine. 🙂