免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1210 | 回复: 0
打印 上一主题 下一主题

linux下安装及配置snmp服务 [复制链接]

论坛徽章:
2
2015年辞旧岁徽章
日期:2015-03-03 16:54:1515-16赛季CBA联赛之上海
日期:2016-05-05 09:45:14
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-29 17:38 |只看该作者 |倒序浏览
1、确保本机已经安装了snmp服务
[root@idc ~]# rpm -qa |grep snmp
net-snmp-libs-5.1.2-11.EL4.7
net-snmp-5.1.2-11.EL4.7
如果没有,那么放入linux安装盘找到snmp的rpm包进行安装,或者到网上搜索适合自己linux发行版本的rpm包进行安装
在新版本的centos及redhat es版本中可能在安装时会提示依赖性错误,这时需要安装lm_sensors-2.8.7-2.40.3.i386.rpm,再安装netsnmp软件。
2、snmpd.conf文件配置
按照如下方式修改snmpd.conf文件
A、修改默认的community string
com2sec notConfigUser default public
将public修改为你才知道的字符串
B、把下面的#号去掉
#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
C、把下面的语句
access notConfigGroup “” any noauth exact systemview none none
改成:
access notConfigGroup “” any noauth exact mib2 none none
3、重启snmpd服务
#/etc/rc.d/init.d/snmpd restart
完成snmpd的配置
4、确保linux的iptables防火墙对我们的流量监控服务器开放了udp 161端口的访问权限
可使用iptables –L –n 查看当前iptables规则
可编辑/etc/sysconfig/iptables文件来修改iptables规则。
把snmpd服务添加为自启动
chkconfig snmpd on
可以用chkconfig –list |grep on 来查看是否已经是自启组
如果chkconfig –list |grep snmpd 没有的话可以先用以下命令增加
chkconfig –add snmpd



com2sec notConfigUser  default       public
创建一个共同体(public) 及其用户(notconfiguser)
group   notConfigGroup   v1           notConfigUser  
定义一个组名(notConfigGroup)及其安全级别( v1) 和用户(notConfigUser )
view    systemview    included   .1.3.6.1.2.1.1
定义一个可操作的范围(.1.3.6.1.2.1.1)
我这里一般改成
view    all   included   .1
access  notConfigGroup ""      any       noauth    exact  systemview none none
定义组的权限 我改成
access  notConfigGroup ""      any       noauth    exact  all  none none



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/249/showart_716263.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP