码迷,mamicode.com
首页 > 系统相关 > 详细

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

时间:2019-03-19 18:55:25      阅读:368      评论:0      收藏:0      [点我收藏+]

标签:container   alt   containe   apt-get   padding   conf   dexp   add   com   

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 …”

标签:container   alt   containe   apt-get   padding   conf   dexp   add   com   

原文地址:https://www.cnblogs.com/zlgxzswjy/p/10560286.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!