声明:文章仅用于个人测试目的。
本例中存储为DellEMC PowerStore,请注意net-snmp版本5.8以上才支持加密功能。
PowerStore SNMP v3支持多种配置:
Security Level: Authentication only/Authentication and privacy
Authentication Protocal: MD5/SHA256
Privacy Protocol: AES256/TDES
确认防火墙开启UDP port 162:
[root@labvm3 ~]# firewall-cmd --list-ports
162/udp
[root@labvm3 ~]#
[root@labvm3 ~]# snmptrapd -v
NET-SNMP Version: 5.8
Web: http://www.net-snmp.org/
Email: net-snmp-coders@lists.sourceforge.net
SNMP trap配置文件里写createUser的格式:
createUser -e <EngineID> <username> <Authentication Protocal> <password> <Privacy Protocol> <password>
PowerStore要求密码相同,所以如开启Privacy,密码和username的密码相同。
EngineID可以从PowerStore GUI--Settings--Networking--SNMP找到,需要转为16进制字符。
可以选择网上online转换,例如https://www.rapidtables.com/convert/number/ascii-to-hex.html,encoding选择UTF-8。
也可以利用Linux od命令转换,去掉空格:
[root@labvm3 ~]# echo -n "PSdbc2e92c1057"|od -A n -t x1|sed 's/ *//g'
5053646263326539326331303537
配置snmptrapd.conf文件,包括v2 community和v3三种配置,以及PowerStore MIB文件位置。
snmpuser1为Authentic