SNMP installation configuration under Linux

Source: Internet
Author: User
Tags auth md5 snmp snmpwalk

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.