SNMP SMUX (RFC 1227) module for BSNMPd

smux_patch2.diff.tar.gz: New patch against the -current of 3rd of August 2006 with a fix to make it compilable on newer current infrastructure.

smux_patch.diff.tar.gz: This is the patch made against -current of today (3rd of August 2006) to add SMUX capabilities to bsnmpd.

If you are using bsnmpd to monitor your network and are frustated because you can't use it to monitor Zebra (i.e. bgpd) or Freeradius (radiusd) then you should try this patch.

It is designed as a bsnmpd loadable module - hence you can load/ unload it to/ from main SNMP agent at any time (but because the patch contains a bunch of changes for core BSNMPd code you have to rebuild - and restart - the bsnmpd agent).

How to build this patch
In order to build it I would suggest to do it outside your main tree. Here it is the procedure in detail:

  1. Create a work area - let's say ~/smuxtest

    mkdir -p ~/smuxtest
    cd ~/smuxtest
  2. Checkout the bsnmpd code from Freebsd cvs:

    cvs co -D 2006/08/03 src/contrib/bsnmp src/lib/libbegemot src/lib/libbsnmp src/usr.sbin/bsnmpd
  3. Patch the sources:

    patch -p1 <  <path_to_patch>/smux_patch.diff 
  4. Export 2 variables in your shell:

    export MK_ATM to 'no' (i.e. export MK_ATM=no in a sh-like shell) 
    and
    LPRSRC to /usr/src/usr.sbin/lpr/common_source (i.e. export LPRSRC=/usr/src/usr.sbin/lpr/common_source)
  5. Build (and install) it

    cd ~/smuxtest/src/usr.sbin
    ln -s /usr/src/usr.sbin/Makefile.inc .
    cd  ~/smuxtest/src/lib/libbsnmp/
    make (and make install as root)
    cd ~/smuxtest/src/usr.sbin/bsnmpd/
    make -E LPRSRC (and make -E LPRSRC install as root)

How to use bsnmpd with Freeradius

Make sure that Freeradius is compiled with snmp. Choose a password for SMUX. This will be shared by SMUX module and radiusd. Let's suppose this password is "secret"

Find the radiusd snmp config file - this is named snmp.conf (by default it is here /usr/local/etc/raddb/snmp.conf) Set the password here:

#
# snmp.conf - snmp configuration directives
#
# This file is *NOT* included by default.  To enable it, you will need
# to modify the SNMP CONFIGURATION section of "radiusd.conf".
#
#######################################################################

#######################################################################
#
#  SNMP configuration
#
#  NOTE: This part is only working if your radiusd is compiled with SNMP
#  support.
#
#  smux_password: Password used for SMUX registration.
#
#....comments deleted
#
#  smux 1.3.6.1.4.1.3317.1.3.1 verysecret
#
#  The default password is an empty password.
#
smux_password = secret
#
#  snmp_write_access:
#
# ....comments deleted
#
# allowed values: {no, yes}
#
snmp_write_access = yes

Edit your bsnmpd config file, usually /etc/snmpd.config, and add these lines for
provisioning (see man snmp_smux) the radiusd SMUX peer into bsnmpd:

begemotSnmpdModulePath."smux" = "/usr/lib/snmp_smux.so"
%smux
begemotSmuxAddr = 127.0.0.1
#begemotSmuxPort = 199
begemotSmuxPeerPassword.1.3.6.1.4.1.3317.1.3.1 = "secret"
begemotSmuxPeerTimeout.1.3.6.1.4.1.3317.1.3.1 = 1
begemotSmuxPeerStatus.1.3.6.1.4.1.3317.1.3.1 = 1

Now (re)start bsnmpd and then radiusd.
You can snmpwalk (via bsnmpd) the radiusd SNMP tree starting with RADIUS-AUTH-SERVER-MIB::radiusMIB

Enjoy and don't forget to provide feedback (soc-victor/at/freebsd/dot/org).

Thanks a lot.
victor cruceru


CategorySNMP

SnmpSmux (last edited 2008-06-17 21:37:43 by localhost)