我已经安装了这些 snmp Ubuntu 包:
snmp snmpd php-snmp libsnmp-base libsnmp-dev
我有以下参数:
$ sudo egrep "^agentaddress|rocommunity" /etc/snmp/snmpd.conf
agentaddress udp:161
# rocommunity: a SNMPv1/SNMPv2c read-only access community name
#rocommunity public default -V systemonly
#rocommunity6 public default -V systemonly
并创建一个 snmp 用户:
$ sudo systemctl stop snmpd
$ sudo net-snmp-config --create-snmpv3-user -ro -a MD5 -x AES svc_snmp
$ sudo egrep "^(rouser|createUser)" /var/lib/snmp/snmpd.conf /usr/share/snmp/snmpd.conf
/usr/share/snmp/snmpd.conf:rouser svc_snmp
$
当我测试时,我得到了这个:
$ sudo systemctl start snmpd
$ snmpget -v3 -u svc_snmp -l authNoPriv -A $MDP_SNMP -a MD5 localhost sysUpTime.0
sysUpTime.0: Unknown Object Identifier (Sub-id not found: (top) -> sysUpTime)
怎么了 ?