本文參考地址:http://blog.163.com/qiushuhui1989@126/blog/static/270110892014119113421364/ui
1. 源碼下載spa
# wget http://download.cloud.360.cn/yjk/net-snmp.tar.gz
2. 解壓code
# tar xzvf net-snmp.tar.gz
3. 初始化(指定的默認的安裝目錄是/usr/local/snmp)blog
# cd net-snmp-5.7.2 # ./configure --prefix=/usr/local/snmp --with-mib-modules=ucd-snmp/diskio -enable-mfd-rewrites
這時候我遇到一個問題:get
BEGIN failed--compilation aborted at Makefile.PL line 1. make: *** [perlmakefiles] Error 2
通過goole搜索,查找到解決方案,順便推薦一個谷歌鏡像地址:(http://www.googto.com):源碼
# yum install cpan -y
4. 編譯和安裝it
make && make install
5. 啓動腳本 (可執行下面命令啓動snmpd服務)io
# /usr/local/snmp/sbin/snmpd