1.snmpd的版本
snmpd -v
NET-SNMP version: 5.0.9
2.对snmpd进行v3设置
具体步骤是:
2.1.查看snmpd支持的加密类型
snmpd -H 2>&1 | grep defPrivType
2.2.创建v3用户
pfexec rm -f /var/sma_snmp/snmpd.conf
pfexec net-snmp-config –create-snmpv3-user
2.3.在/etc/sma/snmp/snmpd.conf中追加下面三行,同时删除rwuser test
rwuser test noauth
rwuser test auth
rwuser test priv
2.4.重启snmpd,并运行以下命令测试:
pfexec svcadm disable /application/management/sma
pfexec svcadm enable /application/management/sma
pfexec cat /var/log/snmpd.log
snmpgetnext -v 3 -u test -l noAuthNoPriv localhost system
snmpgetnext -v 3 -u test -a MD5 -A testtest -l authNoPriv localhost system
snmpgetnext -v 3 -u test -a MD5 -A testtest -x DES -X testtest -l authPriv
localhost system
(最后一条显示:
Encryption support not enabled.
snmpgetnext: USM encryption error)
从提示来看,是该版本的snmpgetnext 不支持DES加密,所以可以使用支持snmp v3的client试一试,应该是可以的,我使用的是snmpB
备注:
SNMPv3:
USM:User-based Security Module for SNMPv3
VACM:View-based Access Control Model for SNMPv3
net-snmp-config –create-snmpv3-user [-ro] [-a authpass] [-x privpass] [-X
DES|AES] [-A MD5|SHA] [username]