- 论坛徽章:
- 0
|
用到SNMP的不多功能,随手记下,方便日后再看.
# First, map the community name "public" into a "security name"
# sec.name source community#com2sec notConfigUser default publiccom2sec t1 x.x.x.x public
##### Second, map the security name into a group name:
# groupName securityModel securityName#group notConfigGroup v1 notConfigUser#group notConfigGroup v2c notConfigUsergroup nets v1 t1group nets v2c t1
##### 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.1view all included .1##### Finally, grant the group read-only access to the systemview view.
# group context sec.model sec.level prefix read write notifaccess notConfigGroup "" any noauth exact systemview none noneaccess nets "" any noauth exact all none none# --------------------------------------------------------------------
下面这个是可选,有时间建议也配上:# It is also possible to set the sysContact and sysLocation system# variables through the snmpd.conf file:
syslocation china-9 (edit /etc/snmp/snmpd.conf)syscontact Root@china-9 (configure /etc/snmp/snmp.local.conf)
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/41439/showart_1388500.html |
|