Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux 伺服器

Linux 上 SNMP 的設定要點逐項解析

一、確認套件已安裝

[root@idc ~]# rpm -qa | grep snmp
net-snmp-libs-5.1.2-11.EL4.7
net-snmp-5.1.2-11.EL4.7

若沒有,可從安裝光碟找到對應的 rpm 安裝,或上網搜尋適合自己發行版本的套件。

二、修改 snmpd.conf

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

三、重啟 snmpd

# /etc/rc.d/init.d/snmpd restart,設定即告完成。

四、開放防火牆

SNMP 走 UDP 161,務必確認 iptables 已對監控伺服器開放該埠。可用 iptables -L -n 檢視目前規則,或直接編輯 /etc/sysconfig/iptables 進行修改。

Copyright © Linux教程網 All Rights Reserved