net-snmp

Install && Use

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[whoami@server1 ~]$ sudo net-snmp-config --create-snmpv3-user -a "my_password" myuser
adding the following line to /var/lib/net-snmp/snmpd.conf:
createUser myuser MD5 "my_password" DES
adding the following line to /etc/snmp/snmpd.conf:
rwuser myuser

[whoami@server1 ~]$ snmpget -v 3 -u myuser -l authNoPriv -a MD5 -A my_password localhost sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (6064) 0:01:00.64

[whoami@server1 ~]$ snmpwalk -v 3 -l authNoPriv -a MD5 -u myuser -A my_password localhost sysDescr
SNMPv2-MIB::sysDescr.0 = STRING: Linux server1 2.6.32-573.el6.x86_64 #1 SMP Wed Jul 1 18:23:37 EDT 2015 x86_64

[whoami@server1 ~]$ snmpwalk -v 3 -l authNoPriv -a MD5 -u myuser -A my_password localhost system
SNMPv2-MIB::sysDescr.0 = STRING: Linux server1 2.6.32-573.el6.x86_64 #1 SMP Wed Jul 1 18:23:37 EDT 2015 x86_64

[whoami@server1 ~]$ snmpwalk -v 3 -l authNoPriv -a MD5 -u myuser -A my_password server1|wc -l
5326

[whoami@server1 ~]$ snmpwalk -v 3 -l authNoPriv -a MD5 -u myuser -A my_password server1 sysUpTime
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (183424) 0:30:34.24

原创文章,转载请注明: 转载自Itweet的博客
本博客的文章集合: http://www.itweet.cn/blog/archive/

参考:
http://www.net-snmp.org/docs/README.snmpv3.html
http://www.net-snmp.org/wiki/index.php/TUT:snmpwalk
http://www.net-snmp.org/wiki/index.php/TUT:SNMPv3_Options