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
# 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
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步