Net-snmp installation and SNMP development in Linux

Source: Internet
Author: User
Tags snmp
Http://avery-leo.javaeye.com/blog/218504 I. EnvironmentOS: RHEL AS4net-snmp version: 5.3.2 2. StepsUnzip unzip (tar-zxvf net-snmp-5.3.2.tar.gz) 4. Enter the net-snmp-5.3.2 directory 5. Run./configure, enter the appropriate information as prompted 6. Run make7. run make install8. installation is complete Iii. Possible Problems 1.Libbeecrypt. La cannot be found. The following error may occur during make

Libtool: Link: cannot find the library '/usr/lib/libbeecrypt. la' (librpmio. La:/usr/lib/libbeecrypt. La)

Make [1]: *** [snmpd] Error 1

Make [1]: Leaving directory '/home/Xxx/Net-snmp-5.3.2/agent'

Make: *** [subdirs] Error 1

Solution: to the executor-zxvf beecrypt-4.1.2.tar.gz #. /configure-Prefix =/usr (installed in/usr/local by default, We need to install it in the/usr directory) # Make # make install 2./Usr/bin/ld: cannot find-lelf. the following error may occur during make.

/Usr/bin/ld: cannot find-lelf

Collect2: LD returned 1 exit status

Make [1]: *** [snmpd] Error 1

Make [1]: Leaving directory '/home/XXX/net-snmp-5.3.2/agent'

Make: *** [subdirs] Error 1

Solution: # ln-s libelf. so.1/usr/lib/libelf. So 3.I have not encountered this problem during installation. For details, refer to echo/usr/local/lib>/etc/lD. So. conf. d/libnetsnmp. conf.
#/Sbin/ldconfig-V
# Make install

 

 

Development considerations:

1. When using mib2c, The MIB file must be placed under/usr/local/share/snmp/mibs.
2. Process: Write the MIB file, convert mib2c to C code, add the project, register the file, and modify the makefile.
3. How to Implement the header_xxxtable function? Table_size is the number of entries, such as several ports.

4. The newly added OID node is defined by the user.

5. If header_generic (simple variable) and header_simple_table (simple table) functions used to determine whether the oId node is valid, improper use will result in the failure to find the node.

6. The data returned to the management end is implemented through the following process:

Switch (VP-> magic ){

Case etherstatsdropevents:

Long_ret = 0;
Return (unsigned char *) & long_ret;

Case etherstatsoctets:

Long_ret = 0;
Return (unsigned char *) & long_ret;

......

}

Of course, these values need to be obtained by calling the corresponding underlying function.

Links:

Http://groups.google.com/group/ems-nms? Hl = ZH-CN % 3fhl % 3den

Http://www.net-snmp.org/wiki/index.php/Tutorials

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.