Debian中snmp的配置(使用监控宝)

安装:
apt-get install snmp snmpd

配置:
Debian5
1、修改/etc/snmp/snmpd.conf

在【first】节中,将如下行前面的"#"去掉,并在其上一行前加“#”:

#com2sec readonly default public

在【third】节中,将“view system”行修改为如下

view mib included .iso.org.dod.internet.mgmt.mib-2 fc

将如下行: access MyROSystem "" any noauth exact system none none

修改为: access MyROSystem "" any noauth exact mib2 none none

 
2、修改/etc/default/snmpd 将"# snmpd options"的下一行中的“127.0.0.1”去掉 

3、重启snmp服务:/etc/init.d/snmpd restart
 

4、测试snmp配置:
 
#snmpwalk -v2c 192.168.0.63 -c public system

5. 设置账号并限制访问IP(以监控宝为例)
注释 com2sec readonly default public

在配置文件最后加入以下内容:
rocommunity jiankongbao 60.195.249.83
rocommunity jiankongbao 60.195.252.107
rocommunity jiankongbao 60.195.252.110
 
Debian6
/etc/snmp/snmpd.conf
充许所有接口访问:
#  Listen for connections from the local system only
# agentAddress  udp:127.0.0.1:161
#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:161,udp6:[::1]:161
 
在文件末尾增加:
rocommunity jiankongbao 60.195.249.83
rocommunity jiankongbao 60.195.252.107
rocommunity jiankongbao 60.195.252.110

posted on 2011-12-15 12:04  ddper  阅读(1483)  评论(0编辑  收藏  举报

导航