為什麼需要使用「Zabbix」 進行「SNMP」監控,因為許多「網路設備 (防火牆、路由器..)」、「印表機設備」 、「儲存設備 ( NAS....)」並無法安裝「Zabbix Agent」但是都支持「SNMP」監控方式。
SNMP 可以監控那些? 處理器、硬碟、記憶體、端口流量..等
1. Zabbix Server 安裝「SNMP」Package
yum install net-snmp* -y
2. 編輯「snmp」配置「檔案」
vi /etc/snmp/snmpd.conf
# First, map the community name "public" into a "security name" ( 預設 廣播字串 public)
# sec.name source community
com2sec notConfigUser default public
# Make at least snmpwalk -v 1 localhost -c public system fast again.
# name incl/excl subtree mask(optional)
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
view systemview included .1 (加入此行)
# Make sure mountd is running
proc mountd
proc mountd
# Make sure there are no more than 4 ntalkds running, but 0 is ok too.
proc ntalkd 4
proc ntalkd 4
# Make sure at least one sendmail, but less than or equal to 10 are running.
proc sendmail 10 1
proc sendmail 10 1
# Check the / partition and make sure it contains at least 10 megs.
disk / 10000
disk / 10000
# Check for loads:
load 12 14 14
service snmpd start
systemctl enable snmpd
4. 瀏覽「SNMP」服務,是否「開啟」
netstat -auntp | grep snmp
5. 測試「SNMP」指令,能否獲取「SNMP」Client端 「Hostname」
snmpwalk -c public -v 2c 192.168.1.14 sysName
參考資料