[root@client ~]# yum install -y net-snmp
[root@client ~]# vim /etc/snmp/snmpd.conf
# sec.name source community com2sec notConfigUser default public view systemview included .1 view systemview included .1.3.6.1.2.1.1 view systemview included .1.3.6.1.2.1.25.1.1
[root@client ~]# systemctl start snmpd.service [root@client ~]# netstat -nlp | grep 161
[root@zabbix ~]# yum install -y net-snmp [root@zabbix ~]# snmpwalk -v 2c -c zabbix 192.168.1.51 | wc -l
添加模版
web
設置 communities
shell
[root@esxi:~] esxcli system snmp set --communities public
[root@esxi:~] esxcli system snmp set --enable true
[root@esxi:~] esxcli network firewall ruleset set --ruleset-id snmp --allowed-all true Already allowed all ip
[root@esxi:~] esxcli network firewall ruleset set --ruleset-id snmp --enabled true
[root@esxi:~] /etc/init.d/snmpd restart root: snmpd Running from interactive shell, running command: esxcli system snmp set -e false. root: snmpd setting up resource reservations. root: snmpd opening firewall port(s) for notifications. root: snmpd watchdog for snmpd started.
[root@esxi:~] esxcli network firewall ruleset set --ruleset-id snmp --allowed-all false
[root@esxi:~] esxcli network firewall ruleset allowedip add --ruleset-id snmp --ip-address 10.0.101.0/24 [root@esxi:~] esxcli network firewall ruleset set --ruleset-id snmp --enabled true
[root@esxi:~] /etc/init.d/snmpd restart
[root@zabbix ~]# yum -y install net-snmp net-snmp-utils net-snmp-devel
[root@zabbix ~]# snmpwalk -v 2c -c sunwoda 192.168.9.24:161 | wc -l 4594
添加模板
vim
設置 communities
服務器