Press "Enter" to skip to content

Setup and Test of the BalanceNG SNMPD interface

The needed Debian and Ubuntu packages are snmpd and snmp (tiny-snmpd does not work for some reason).

The following redonly “com2sec” mapping is recommended (in /etc/snmp/snmpd.conf), just uncomment as follows:

     #       sec.name  source          community
     #com2sec paranoid  default         public
     com2sec  readonly  default         public
     #com2sec readwrite default         private

Additionally, the following line needs to be present in /etc/snmp/snmpd.conf in order to establish the interface between snmpd and BalanceNG:

     pass .1.3.6.1.4.1.2771.1 /sbin/bng

Note: There’s no need to change /etc/default/snmpd anymore with 2.226 and above (snmpd runs now as user snmp).

A typical “snmpget” command line looks like this:

     snmpget -v1 -c public localhost .1.3.6.1.4.1.2771.1.1

A complete “snmpwalk” of the BalanceNG 2.x MIB can be invoked like this:

     snmpwalk -v1 -c public localhost .1.3.6.1.4.1.2771.1

The BALANCENG-MIB may be copied to the /usr/share/snmp/mibs directory (for Ubuntu/Debian Linux). The following environment variable setting makes all MIBs in this directory available to the snmpd tools:

     export MIBS=ALL

Note the difference between the two “snmpget” invocations below:

     $ snmpget -v1 -c public localhost .1.3.6.1.4.1.2771.1.1
     SNMPv2-SMI::enterprises.2771.1.1 = STRING: "2.228"
     $ export MIBS=ALL
     $ snmpget -v1 -c public localhost .1.3.6.1.4.1.2771.1.1
     BALANCENG-MIB::Release = STRING: "2.228"

You may also setup a local snmp.conf like this to make this setting permanent:

     $ mkdir -p $HOME/.snmp
     $ echo "mibs ALL" >> $HOME/.snmp/snmp.conf