Installing MIB in Ubuntu and Solving the Error “SNMP Cannot Find Module …”

Posted 隐念笎

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Installing MIB in Ubuntu and Solving the Error “SNMP Cannot Find Module …”相关的知识,希望对你有一定的参考价值。

Has noticed an error after executing the command snmpwalk with the indication of MIB instead of OID:

1
2
snmpwalk -v 2c -c public 192.168.0.1 ifIndex
ifIndex: Unknown Object Identifier (Sub-id not found: (top) -> ifIndex)

And:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
For error such as:
Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-TYPES): At line 0 in (none)
Cannot find module (SNMPv2-TC): At line 10 in /usr/share/mibs/netsnmp/UCD-DLMOD-MIB
Cannot find module (SNMPv2-SMI): At line 34 in /usr/share/mibs/netsnmp/UCD-SNMP-MIB
Cannot find module (SNMPv2-TC): At line 37 in /usr/share/mibs/netsnmp/UCD-SNMP-MIB
Did not find ‘enterprises’ in module #-1 (/usr/share/mibs/netsnmp/UCD-SNMP-MIB)
Did not find ‘DisplayString’ in module #-1 (/usr/share/mibs/netsnmp/UCD-SNMP-MIB)
Did not find ‘TruthValue’ in module #-1 (/usr/share/mibs/netsnmp/UCD-SNMP-MIB)
Unlinked OID in UCD-SNMP-MIB: ucdavis ::= { enterprises 2021 }
Undefined identifier: enterprises near line 39 of /usr/share/mibs/netsnmp/UCD-SNMP-MIB
Did not find ‘DisplayString’ in module #-1 (/usr/share/mibs/netsnmp/UCD-DLMOD-MIB)
Did not find ‘ucdExperimental’ in module UCD-SNMP-MIB (/usr/share/mibs/netsnmp/UCD-DLMOD-MIB)
...

We look at the tree of mibs:

1
snmptranslate -Tp

The solution to the above errors is the execution of the following commands:

1
2
3
4
sudo apt-get install snmp-mibs-downloader
sudo download-mibs
sudo sed -i "s/^(mibs *:).*/#1/" /etc/snmp/snmp.conf
sudo service snmpd restart

以上是关于Installing MIB in Ubuntu and Solving the Error “SNMP Cannot Find Module …”的主要内容,如果未能解决你的问题,请参考以下文章

PHP报错Cannot adopt OID in UCD-SNMP-MIB LM-SENSORS-MIB

Installing Intellij IDEA on Ubuntu

Installing Selenium and ChromeDriver on Ubuntu

Installing Selenium and ChromeDriver on Ubuntu

Installing PHP5 on Ubuntu Server

Installing Ubuntu 18.04 by USB flash drive