zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    查看mysql数据库引擎
    crontab 从nano 转换为 vim
    Linux中,去掉终端显示的当前目录的绝对路径
    nginx 卸载后重新安装/etc/nginx配置文件没了,cannot open /etc/nginx/nginx.conf (No such file or directory)
    rabbitmq 配置
    OSError: mysql_config not found
    No module named 'ConfigParser'
    windows 安装tensorflow
    微服务架构设计
    centOS rabbitmq 安装
  • 原文地址:https://www.cnblogs.com/zlgxzswjy/p/10560286.html
Copyright © 2011-2022 走看看