[root@idc ~]# rpm -qa | grep snmp
net-snmp-libs-5.1.2-11.EL4.7
net-snmp-5.1.2-11.EL4.7
若沒有,可從安裝光碟找到對應的 rpm 安裝,或上網搜尋適合自己發行版本的套件。
A. 改掉預設的 community string。找到這行:
com2sec notConfigUser default public
把 public 換成一組只有你知道的字串。community string 等同密碼,預設值不改等於門戶大開。
B. 取消下面這行的註解:
#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
C. 修改存取控制行。把:
access notConfigGroup "" any noauth exact systemview none none
改為:
access notConfigGroup "" any noauth exact mib2 none none
# /etc/rc.d/init.d/snmpd restart,設定即告完成。
SNMP 走 UDP 161,務必確認 iptables 已對監控伺服器開放該埠。可用 iptables -L -n 檢視目前規則,或直接編輯 /etc/sysconfig/iptables 進行修改。