我做了一个SNMPv3的设置,以testing它如何与一些第三方脚本集成。
我需要使用1.3.6.1.4.1.2021中的一些MIBS来做到这一点,但不能成功地做到这一点。 目前在使用rocommunity的时候,只有SNMPv1和SNMPv2能够通过snmpwalk返回预期的结果。
已经失去了超过1天的日志,运行数据包和进程转储,以找出问题。 最后发现SNMPv1和SNMPv2似乎一切正常。 rocommunity似乎解决了v1和v2的问题,但对于v3来说这个部分是不够的。
如果其他人遇到过这个问题或有想法请分享。
这里是关于我的设置的一些细节。
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS" NAME="Ubuntu" VERSION="14.04.3 LTS, Trusty Tahr" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 14.04.3 LTS"
# 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 # loading them by commenting out the following line. mibs +ALL
syslocation MyLocation syscontact [email protected] sysservices 72 createUser usr-automation MD5 AUNIKTOKENISHERE01 DES usr-automation-pass createUser usr-automation5 MD5 AUNIKTOKENISHERE05 DES usr-automation5-pass createUser usr-automation7 MD5 AUNIKTOKENISHERE07 DES usr-automation7-pass rwuser usr-automation priv 1.3.6.1.2.1 rouser usr-automation5 priv 1.3.6.1.2.1 rouser usr-automation7 priv 1.3.6.1.2.1 rocommunity AUNIKTOKENISHERE00
ii libsnmp-base 5.7.2~dfsg-8.1ubuntu3.1 all SNMP configuration script, MIBs and documentation ii libsnmp30:amd64 5.7.2~dfsg-8.1ubuntu3.1 amd64 SNMP (Simple Network Management Protocol) library ii snmp 5.7.2~dfsg-8.1ubuntu3.1 amd64 SNMP (Simple Network Management Protocol) applications ii snmp-mibs-downloader 1.1 all Install and manage Management Information Base (MIB) files ii snmpd 5.7.2~dfsg-8.1ubuntu3.1 amd64 SNMP (Simple Network Management Protocol) agents
snmpwalk命令的结果如下:
snmpwalk -v 1 -c AUNIKTOKENISHERE00 localhost 1.3.6 | grep 2021 # result is as expected snmpwalk -v 2c -c AUNIKTOKENISHERE00 localhost 1.3.6 | grep 2021 # result is as expected snmpwalk -v 3 -u usr-automation7 -l authPriv -a MD5 -A AUNIKTOKENISHERE07 -x DES -X usr-automation7-pass | grep 2021 # returns only some basic informations which isn't enough (ex: iso.3.6.1.2.1.1.1.0 ), but the 2021 MIBS are missing