标签:
cat /etc/snmp/snmpd.conf such as below :
==============================================
# First, map the community name "public" into a "security name"
# sec.name source community
com2sec notConfigUser default public #default is all IP address
# Second, map the security name into a group name:
# groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
# Third, create a view for us to let the group have rights to:
# 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 all none none
view all included .1 80
view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
==============================================
snmpwalk 命令则是测试系统各种信息最有效的方法,常用的方法如下:
1、snmpwalk -c public -v 1 -m ALL 10.0.1.52 .1.3.6.1.2.1.25.1 得到取得windows端的系统进程用户数等
2、snmpwalk -c public -v 1 -m ALL 10.0.1.52 .1.3.6.1.2.1.25.2.2 取得系统总内存
3、snmpwalk -c public -v 1 -m ALL 10.0.1.52 hrSystemNumUsers 取得系统用户数
4、snmpwalk -c public -v 1 -m ALL 10.0.1.52 .1.3.6.1.2.1.4.20 取得IP信息
5、snmpwalk -v 2c -c public 10.0.1.52 system 查看系统信息
6、snmpwalk -v 1 10.0.1.52 -c public ifDescr 获取网卡信息
1、snmpwalk -v 2c -c public 10.0.1.52 .1.3.6.1.2.1.25.1 得到取得windows端的系统进程用户数等
其中-v是指版本,-c 是指密钥。
snmpwalk功能很多,可以获取系统各种信息,只要更改后面的信息类型即可。如果不知道什么类型,也可以不指定,这样所有系统信息都获取到:
snmpwalk -v 2c -c public XXXXXXX
标签:
原文地址:http://www.cnblogs.com/baxk/p/5084683.html