Ubuntu snmp的問題

來源:互聯網
上載者:User

Ubuntu snmp的問題 Ubuntu 12.04 didn’t install the MIB files. Even if you install the SNMP applications. Just check the preamble of /etc/snmp/snmp.conf ## 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# loaging them by commenting out the following line.mibs : Sure, but how can I install them ? Fortunately there is a package to deal with that. $ sudo apt-get install snmp-mibs-downloader It will download the IETF MIB files and install them under the usual /usr/share/mibs/ If for any reason you don’t see it happen force it with $ sudo download-mibs You can repeat this command later to update any new MIB file. 安裝完成後,測試 snmpwalk -v 2c -c public localhostUnlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIBBad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDUUndefined OBJECT-GROUP (diffServMIBMultiFieldClfrGroup): At line 2195 in /usr/share/mibs/ietf/IPSEC-SPD-MIBUndefined OBJECT-GROUP (diffServMultiFieldClfrNextFree): At line 2157 in /usr/share/mibs/ietf/IPSEC-SPD-MIBUndefined OBJECT-GROUP (diffServMIBMultiFieldClfrGroup): At line 2062 in /usr/share/mibs/ietf/IPSEC-SPD-MIBExpected "::=" (RFC5644): At line 493 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIBExpected "{" (EOF): At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIBBad object identifier: At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIBBad parse of OBJECT-IDENTITY: At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB 解決辦法: #!/bin/bashfor i in /usr/share/mibs/ietf/IPSEC-SPD-MIB /usr/share/mibs/ietf/IPATM-IPMC-MIB /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB /usr/share/mibs/ietf/SNMPv2-PDUdomv $i /usr/share/mibsdone 另外snmpwalk -v 2c -c public 192.168.1.1 mem可以使用,snmpwalk -v 2c -c public 192.168.1.1 cpu不能使用,因為不存在cpu這個logical name,所以,直接使用OID,snmpwalk -v 2c -c public 192.168.1.1 .1.3.6.1.2.1.25.3.3.1.2 snmpwalk -v 2c -c public 192.168.1.1 .1.3.6.1.2.1.25.3.3.1.2HOST-RESOURCES-MIB::hrProcessorLoad.768 = INTEGER: 1HOST-RESOURCES-MIB::hrProcessorLoad.769 = INTEGER: 0HOST-RESOURCES-MIB::hrProcessorLoad.770 = INTEGER: 0HOST-RESOURCES-MIB::hrProcessorLoad.771 = INTEGER: 1HOST-RESOURCES-MIB::hrProcessorLoad.772 = INTEGER: 0HOST-RESOURCES-MIB::hrProcessorLoad.773 = INTEGER: 0HOST-RESOURCES-MIB::hrProcessorLoad.774 = INTEGER: 1HOST-RESOURCES-MIB::hrProcessorLoad.775 = INTEGER: 0HOST-RESOURCES-MIB::hrProcessorLoad.776 = INTEGER: 1HOST-RESOURCES-MIB::hrProcessorLoad.777 = INTEGER: 1HOST-RESOURCES-MIB::hrProcessorLoad.778 = INTEGER: 1HOST-RESOURCES-MIB::hrProcessorLoad.779 = INTEGER: 2HOST-RESOURCES-MIB::hrProcessorLoad.780 = INTEGER: 0HOST-RESOURCES-MIB::hrProcessorLoad.781 = INTEGER: 1HOST-RESOURCES-MIB::hrProcessorLoad.782 = INTEGER: 0HOST-RESOURCES-MIB::hrProcessorLoad.783 = INTEGER: 0 另;精簡的snmpd.conf ####    # First, map the community name "public" into a "security name"    #ec.name source community    com2sec my_user 192.168.1.1 public    ####    # Second, map the security name into a group name:    # groupName securityModel securityName    group my_group v2c my_user    ####    # Third, create a view for us to let the group have rights to:    # name incl/excl subtree mask(optional)    view all included .1 80    ####    # Finally, grant the group read-only access to the systemview view.    # group context sec.model sec.level prefix read write notif    access my_group "" any noauth exact all none none    ####    # Customer    pass_persist .1.3.6.1.3.1 /usr/bin/perl /usr/local/bin/iostat-persist.pl 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.