Take the installation configuration of Redhat as an example:
Compiling and installing
First we need to download NET-SNMP source code, select a version, such as the latest version of 5.7.1, the address is as follows:
Http://www.software8.co/software/wlbc/1637.html
Next, unzip the downloaded source code package as follows:
Tar xzvf net-snmp-5.7.1.tar.gz
The compilation rules are then generated by configure, as follows:
CD net-snmp-5.7.1
./configure--prefix=/usr/local/snmp--with-mib-modules=ucd-snmp/diskio--with-default-snmp-version= "3"
The--with-mib-modules=ucd-snmp/diskio option allows the server to support disk I/O monitoring.
--with-default-snmp-version option, is the default install V3 version
--with-sys-location position
--with-sys-contact Contact
--with-logfile Log file directory
--with-persistent-directory
Next, start compiling and installing
Make && make install
So far, we've got an SNMP agent that can run, it's in/usr/local/snmp/sbin/snmpd, and we're going to have to do some necessary setup before we start it.
Configuring the V3 version
Example.conf to =/usr/local/snmp/share/snmp/snmpd.conf under the copy source package
Cp/home/net-snmp-5.7.1/example.conf/usr/local/snmp/share/snmp/snmpd.conf
modifying snmpd.conf files
Rouser UniMas Auth
Note: When adding users, make sure that the SNMP service is not running or cannot be added.
As you can see, in V3, "Rouser" is used to represent a read-only account type, and subsequent "Jiankongbao" is the specified username, followed by "auth" to indicate the need for verification.
CreateUser UniMas MD5 MyPassword
This line of configuration means creating a user named "UniMas" with the password "MyPassword" and encrypting the transmission with MD5. Here's a reminder:
Password must be at least 8 bytes
Cp/usr/local/snmp/share/snmp/snmpd.conf/var/net-snmp/snmpd.conf
Setting the NET-SNMP environment variable
Set the environment variable to append under the/etc/profile file
Path=/usr/local/snmp/bin:/usr/local/snmp/sbin: $PATH
Export PATH
Add to Startup file
Append at end of/etc/rc.local file
/usr/local/snmp/sbin/snmpd-c/usr/local/snmp/share/snmp/snmpd.conf&
Restart the NET-SNMP service
/usr/local/snmp/sbin/snmpd-c/usr/local/snmp/share/snmp/snmp.conf&
Or use the service snmpd stop
Service SNMPD Start
Test
/usr/local/snmp/bin/snmpwalk-v 3-l authnopriv-a md5-u unimas-a hzhz2003 127.0.0.1:161 SYSDESCR
Normal words will appear.
snmpv2-mib::sysdescr.0 = String:linux localhost.localdomain 2.6.18-274.el5 #1 SMP Fri June 04:43:29 EDT x86_64
Test/usr/local/snmp/bin/snmpwalk-v 3-l authnopriv-a md5-u unimas-a hzhz2003 if
Back up the network card and other information
Indicates successful installation configuration