环境Centos7虚拟机
安装SNMP服务器
yum install -y net-snmp net-snmp-utils net-tools.x86_64
sed -i '/view systemview included .1.3.6.1.2.1.1/i view systemview included .1' /etc/snmp/snmpd.conf
sed -i 's/access notConfigGroup "" any noauth exact systemview none none/access notConfigGroup "" any noauth exact all none none/' /etc/snmp/snmpd.conf
sed -i 's/#view all included .1 80/view all included .1 80/' /etc/snmp/snmpd.conf
#----------------------------------------------------------------
firewall-cmd --add-service=snmp --zone=public --permanent
firewall-cmd --add-port=161/udp --zone=public --permanent
firewall-cmd --reload
systemctl restart snmpd
systemctl enable snmpd
systemctl status snmpd
用snmpwalk 工具测试 下面链接是snmp文件的详细配置 /etc/snmp/snmpd.conf
snmpwalk -v 2c 127.0.0.1 -c public system
网友评论