[root@cacti cacti]# tar zvxf net-snmp-5.4.2.1.tar.gz
[root@cacti cacti]# cd net-snmp-5.4.2.1
[root@cacti net-snmp-5.4.2.1]# ./configure --prefix=/usr/local/net-snmp --enable-mfd-rewrites --with-default-snmp-version="2" --with-sys-contact="root,E_mail:qubaoquan@163.com" --with-sys-location="china" --with-logfile="/var/log/net-snmpd.log" --with-persistent-directory="/var/net-snmp" --enable-developer
[root@cacti net-snmp-5.4.2.1]# make
[root@cacti net-snmp-5.4.2.1]# make install
[root@cacti net-snmp-5.4.2.1]# cp EXAMPLE.conf /usr/local/net-snmp/share/snmp/snmpd.conf
[root@cacti net-snmp-5.4.2.1]# vi /usr/local/net-snmp/share/snmp/snmpd.conf (更改如下)
[root@cacti net-snmp-5.4.2.1]# /usr/local/net-snmp/sbin/snmpd
[root@cacti net-snmp-5.4.2.1]# vi + /etc/rc.local(添加如下)
/usr/local/net-snmp/sbin/snmpd
[root@cacti net-snmp-5.4.2.1]#iptables -I INPUT -p udp --dport 161 -j ACCEPT
[root@cacti net-snmp-5.4.2.1]#/etc/init.d/iptables save