一.NET-SNMP包的安装与配置
1.安装net-snmp:
Ubuntu11.10:apt-get install snmp snmpdCentOS6.2: yum install net-snmp net-snmp-devel net-snmp-utils
启动SNMP服务:/etc/init.d/snmpd start
查看SNMP版本:snmpget --version
2.SNMP配置:/etc/snmp/snmpd.conf(需要root权限)
(1)对于SNMP V3版本,默认设置是监听本机的snmp请求,应该将其修改成成监听所有设备的请求,V2c版本不用修改。
# Listen for connections from the local system only
#agentAddress udp:127.0.0.1:161
# Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:161,udp6:[::1]:161
(2)配置SNMP的访问权限,
默认的访问权限设置如下,这个设置只能收集到系统的基本信息。
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
# group context sec.