Installing the SNMPD connector library

Installing the overlay

The dev-libs/snmpd-connector-lib package is not currently available as part of the official Gentoo Linux distribution but is distributed using an overlay maintained and supported by us at Hacking Networked Solutions. Before the dev-libs/snmpd-connector-lib package can be installed therefore the overlay must first be installed by following the instructions in the Installing the Hacking Networked Solutions overlay for Gentoo Linux section of the Hacking Networked Solutions overlay for Gentoo Linux documentation.

Installing the package

Once the required overlay has been installed the installation of the dev-libs/snmpd-connector-lib package is as easy as any other on Gentoo Linux and is performed using the emerge application as usual as shown below.

lisa emerge -pv snmpd-connector-lib
These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild      ] dev-libs/hacking-bash-lib-0.1
[ebuild      ] dev-libs/snmpd-connector-lib-0.3

Once you are happy that the dev-libs/snmpd-connector-lib package will not install any dependencies you do not require, and that the dependencies which will be installed have the correct use-flags set, you can install the package as shown below.

lisa emerge snmpd-connector-lib

Depending on the package

Once you have used the dev-libs/snmpd-connector-lib package to develop SNMPD extension agents of your own you may wish to distribute them to other members of the community. The example code below (taken from the SNMPD-MDRAID connector ebuild) demonstrates how to include the relevant libraries and applications as run-time dependencies of a package.

Listing 1 - snmpd-mdraid-connector-0.3.ebuild
  1. RDEPEND=">=dev-libs/snmpd-connector-lib-0.3
  2.          dev-libs/hacking-bash-lib
  3.          snmp-mibs/mdraid-snmp-mib
  4.          net-analyzer/net-snmp
  5.          sys-fs/mdadm"
Example code demonstrating run-time dependencies for the MD-RAID extension agent

Clearly, unless your extension agent requires them, the snmp-mibs/mdraid-snmp-mib and sys-fs/mdadm packages will usually be replaced with the MIB your agent represents and any associated utilities required to extract the relevant information from the system.