1、安装net-snmp
# yum install -y net-snmp
2、修改配置文件
# vim /etc/snmp/snmpd.conf
40 # sec.name source community
41 com2sec notConfigUser default zabbix #社区名称定义为zabbix
55 view systemview included .1 #添加一个采集项.1,意味着可以采集到所有mib tree的信息
56 view systemview included .1.3.6.1.2.1.1
57 view systemview included .1.3.6.1.2.1.25.1.1
3、如开启防火墙添加策略允许访问
# firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="*.*.*.*/32" port protocol="udp" port="161" accept" #允许zabbix-server "*.*.*.*/32"通过161端口访问
success
# firewall-cmd --reload
success
4、启动
# systemctl start snmpd.service
# netstat -lntup|grep 161 udp 0 0 0.0.0.0:161
0.0.0.0:* 59093/snmpd
5、在zabbix server上测试
# snmpwalk -v 2c -c zabbix 192.168.1.51|wc -l
yum安装snmp