2010年12月12日 星期日

CentOS install snmp

確認一下有裝了嗎 ?
# rpm -qa | grep net-snmp
net-snmp-utils-5.3.2.2-9.el5_5.1
net-snmp-libs-5.3.2.2-9.el5_5.1
net-snmp-5.3.2.2-9.el5_5.1

沒有的話就裝吧
#yum install -y net-snmp
#yum install -y net-snmp-libs
#yum install -y net-snmp-utils

修改設定
#vi /etc/snmp/snmpd.conf
com2sec notConfigUser default MyCommunity

group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser

view all included .1 80
view system included .iso.org.dod.internet.mgmt.mib-2.system

access notConfigGroup "" any noauth exact all none none

讓它重開也會開啟
#chkconfig snmpd on
設定完成生效重啟
#service snmpd restart

確認成功與否
#snmpwalk -v 2c -c MyCommunity localhost system



失敗的話看防火牆有沒有擋到161 udp port、防火牆有開啟否
#netstat -ln | grep 161
#service iptables status
修改 /etc/sysconfig/iptables (或 /etc/sysconfig/iptables-config)
增加如下:
-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 161 -j ACCEPT

restart iptables
#/etc/init.d/iptables restart

沒有留言:

張貼留言

COVID-19 確診經歷紀實

原本以為真的是天選之人,就算先前家裡兩個小孩都確診都逃過了(可能有中獎但無症狀吧),不過就在2023年六月18日破解自認為天選之人的"心態",為什麼可以確認就是這天中獎的呢?因為在前都是居家上班,到人多的室內場所都會戴口罩,就剛好這天傍晚原本只想說要去附近的國...