CentOS安裝配置SNMP

來源:互聯網
上載者:User

CentOS安裝配置SNMP

1.確保Linux主機已經安裝了snmp服務

rpm -qa |grep snmp

如果沒有,那麼放入Linux安裝盤找到snmp的rpm包進行安裝,或者到網上搜尋適合自己Linux發行版本的rpm包進行安裝,或者使用yum.

2.安裝

需要安裝的大概有

yum install -y net-snmpnet-snmp-develnet-snmp-libsnet-snmp-perlnet-snmp-utilsmrtg

其中有一些不是必須的, -y 指的是對所有問題回答yes,省去安裝時的互動。

3.啟動

輸入

snmpd

service snmpd start

並用

service snmpd status

察看服務狀態。

注意:有時輸入service snmpd status 後出現

snmpd dead but pid file exists

或者

snmpd dead but subsys locked

原因是沒有先輸入snmpd,原理還不是很明白,但是先記著吧。

4.配置

裝好之後修改/etc/snmp/snmpd.conf對其進行配置

A、修改預設的community string
com2sec notConfigUser default public
將public修改為你才知道的字串

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

5.重啟snmpd服務

/etc/rc.d/init.d/snmpd restart

完成snmpd的配置

6.確保Linux的iptables防火牆對我們的流量監控伺服器開放了udp 161連接埠的存取權限
可使用iptables -L -n 查看當前iptables規則
可編輯/etc/sysconfig/iptables檔案來修改iptables規則

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.