在Linux下安装完成net-snmp之后,生成/etc/snmp/snmpd.conf配置文件,现对此配置文件进行一下说明:
第一步:
定义团体字并映射到安全名。(如示例中,定义团体字为public,并映射到安全名notConfigUser)
# First, map the community name "public" into a "security name"
# sec.name source community
com2sec notConfigUser default public
第二步:
将第一步所定义的安全名(notConfigUser)关联到某个组名(notConfigGroup)。
# Second, map the security name into a group name:
# groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
第三步:
定义一个视图(view),并设置其可以查看的snmp oid树范围。
# Third, create a view for us to let the group have rights to:
# Make at least snmpwalk -v 1 localhost -c public system fast again.
# name incl/excl subtree mask(optional)
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
最后一步:
对每二步定义的组进行授权,也就是定义所配置的组的相应访问权限(上下文、安全认证、可查看视图、读写权限等)
# Finally, grant the group read-only access to the systemview view.
# group context sec.model sec.level prefix read write notif
access notConfigGroup "" any noauth exact systemview none none
补充:
还有两个可以说是补充性的配置:系统联系信息和日志记录。
syslocation xxxxx //系统的位置信息
syscontact xxxxx //系统的联系人
dontLogTCPWrappersConnects yes //不记录"Conection from UDP:*******"信息到日志文件之中,如注释掉此行,将会记录大量的Conection from UDP:的信息到日志文件中
linux snmpd.conf
原创
©著作权归作者所有:来自51CTO博客作者linchqd的原创作品,请联系作者获取转载授权,否则将追究法律责任

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
移植snmpd
www.net-snmp.org本系统使用版本: net-snmp-5.1.4解压缩有进入源码目录键
perl linux 服务器 snmpd 交叉编译