Centos 6.5 SNMP用戶端安裝及配置版本net-snmp-5.7.3

來源:互聯網
上載者:User

標籤:http   io   ar   os   sp   for   on   art   log   

Centos 6.5 SNMP用戶端安裝及配置
SNMP版本:net-snmp-5.7.3.tar.gz
1.下載軟體
cd /usr/local/src
yum -y install gcc
wget http://nchc.dl.sourceforge.net/project/net-snmp/net-snmp/5.7.3/net-snmp-5.7.3.tar.gz

2.解壓編譯安裝
tar -zxvf net-snmp-5.7.3.tar.gz
cd net-snmp-5.7.3
./configure --with-default-snmp-version="2"  --with-sys-contact="zjqs"  --with-sys-location="XSIDC" --with-logfile="/var/log/snmpd.log"  --with-persistent-directory="/opt/net-snmp"
make
make install

4.配置

/usr/local/sbin/snmpd
/usr/local/sbin/snmpd會在/opt/下產生/opt/net-snmpd/snmpd.conf
cd /opt/net-snmpd/
vim snmpd.conf
添加以下內容
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view all included .1
access notConfigGroup "" any noauth exact all none none
syslocation www.osyunwei.com



注釋說明
public為團體號
syslocation 為位置
啟動snmpd
cd /opt/net-snmpd
/usr/local/sbin/snmpd -c snmpd.conf

編譯防火牆策略
vim /etc/sysconfig/iptables 添加以下內容
-A INPUT -m udp -p udp --dport 161 -j ACCEPT

重啟防火牆

service iptables restart



指令碼一鍵安裝
#!/bin/bash
cd /usr/local/src
yum -y install gcc
wget http://nchc.dl.sourceforge.net/project/net-snmp/net-snmp/5.7.3/net-snmp-5.7.3.tar.gz
tar -zxvf net-snmp-5.7.3.tar.gz
cd net-snmp-5.7.3
./configure --with-default-snmp-version="2"  --with-sys-contact="zjqs"  --with-sys-location="XSIDC" --with-logfile="/var/log/snmpd.log"  --with-persistent-directory="/opt/net-snmp"
make
make install
/usr/local/sbin/snmpd
cd /opt/net-snmpd/
echo "com2sec notConfigUser default public">snmpd.conf
echo "group notConfigGroup v1 notConfigUser">>snmpd.conf
echo "group notConfigGroup v2c notConfigUser">>snmpd.conf
echo "view all included .1">>snmpd.conf
echo "access notConfigGroup "" any noauth exact all none none">>snmpd.conf
echo "syslocation www.osyunwei.com">>snmpd.conf
/usr/local/sbin/snmpd -c snmpd.conf
echo "-A INPUT -m udp -p udp --dport 161 -j ACCEPT">>/etc/sysconfig/iptables
備忘:推薦更改一下團體號

Centos 6.5 SNMP用戶端安裝及配置版本net-snmp-5.7.3

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.