diff --git a/build/autoMakefile.am.toplevel b/build/autoMakefile.am.toplevel
index e42c7252b26348a7cc77f05ef546aeff553e1ef2..5ecc7d16b5233621cd03ff7463d070ff044b689b 100644
--- a/build/autoMakefile.am.toplevel
+++ b/build/autoMakefile.am.toplevel
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = foreign
 
-SUBDIRS := . build @LIBSYSIO_SUBDIR@ portals lustre
-DIST_SUBDIRS := build libsysio portals lustre
+SUBDIRS := . build @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ portals lustre
+DIST_SUBDIRS := build @SNMP_DIST_SUBDIR@ libsysio portals lustre
 
 EXTRA_DIST := config.h.in
 
diff --git a/build/autoconf/lustre-build.m4 b/build/autoconf/lustre-build.m4
index 8d0db0a00a309d757716180fe76cb3b83b6f68a3..b2a516b92de264857e5241523328b37088169f0a 100644
--- a/build/autoconf/lustre-build.m4
+++ b/build/autoconf/lustre-build.m4
@@ -190,6 +190,16 @@ else
 fi
 ])
 
+#
+# LB_PATH_SNMP
+#
+# check for in-tree snmp support
+#
+AC_DEFUN([LB_PATH_SNMP],
+[LB_CHECK_FILE([$srcdir/snmp/lustre-snmp.c],[SNMP_DIST_SUBDIR="snmp"])
+AC_SUBST(SNMP_DIST_SUBDIR)
+])
+
 #
 # LB_CONFIG_MODULES
 #
@@ -444,6 +454,7 @@ LB_DARWIN_CONDITIONALS
 
 LP_CONDITIONALS
 LC_CONDITIONALS
+LS_CONDITIONALS
 ])
 
 #
@@ -462,6 +473,7 @@ LB_PROG_CC
 
 LB_PATH_LIBSYSIO
 LB_PATH_CRAY_PORTALS
+LB_PATH_SNMP
 
 LB_CONFIG_DOCS
 LB_CONFIG_UTILS
@@ -474,6 +486,9 @@ LC_CONFIG_LIBLUSTRE
 
 LP_CONFIGURE
 LC_CONFIGURE
+if test "$SNMP_DIST_SUBDIR" ; then
+	LS_CONFIGURE
+fi
 
 LB_CONDITIONALS
 LB_CONFIG_HEADERS
@@ -489,6 +504,9 @@ build/lustre.spec
 
 LP_CONFIG_FILES
 LC_CONFIG_FILES
+if test "$SNMP_DIST_SUBDIR" ; then
+	LS_CONFIG_FILES
+fi
 
 AC_SUBST(ac_configure_args)
 
diff --git a/build/autogen.sh b/build/autogen.sh
index 05be061f63b04c8bdbc95793d75a8a6285ddb6ca..b27e0f983b57f3ff3c85954ddf1ff76b52b27a76 100644
--- a/build/autogen.sh
+++ b/build/autogen.sh
@@ -78,6 +78,7 @@ check_version() {
 }
 
 echo "Checking for a complete tree..."
+# required directories
 for dir in build portals lustre ; do
     if [ ! -d "$dir" ] ; then
 	cat >&2 <<EOF
@@ -88,6 +89,12 @@ EOF
     fi
     ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
 done
+# some are optional
+for dir in snmp ; do
+    if [ -d "$dir" ] ; then
+	ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
+    fi
+done
 
 check_version automake automake-1.7 "1.7.8"
 check_version autoconf autoconf "2.57"
diff --git a/build/buildcvs b/build/buildcvs
index f2187dcecdb0629d253d7abe460a9923a6e76787..3013ff0cdf9d5ad5b7226383888c78247a8a617f 100644
--- a/build/buildcvs
+++ b/build/buildcvs
@@ -2,7 +2,7 @@
 
 portalstag="HEAD"
 libsysiotag="HEAD"
-snmptag=""
+snmptag="HEAD"
 
 export LC_COLLATE=C
 
@@ -78,4 +78,5 @@ esac
 
 cvs_cmd libsysio libsysio "$libsysiotag"
 cvs_cmd portals portals "$portalstag"
+cvs_cmd snmp lustre-snmp "$snmptag"
 cvs_cmd lustre lustre-core "$lustretag"
diff --git a/build/lustre.spec.in b/build/lustre.spec.in
index 33d4d467b3cb78f5289c6546e9b17eaacc304f0d..6e56726c94bcf27490801de82d66e36374528422 100644
--- a/build/lustre.spec.in
+++ b/build/lustre.spec.in
@@ -126,11 +126,16 @@ cat >lustre.files <<EOF
 %attr(-, root, root) /usr/share/lustre/lustre2ldif.xsl
 %attr(-, root, root) /usr/share/lustre/top.ldif
 EOF
-if [ -f $RPM_BUILD_ROOT/usr/lib/liblustre.so ] ; then
+if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
   echo '%attr(-, root, root) %{_libdir}/liblustre.a' >>lustre.files
   echo '%attr(-, root, root) %{_libdir}/liblustre.so' >>lustre.files
 fi
 
+if [ -d $RPM_BUILD_ROOT%{_libdir}/lustre/snmp ] ; then
+  echo '%attr(-, root, root) %{_libdir}/lustre/snmp' >>lustre.files
+  echo '%attr(-, root, root) %{_datadir}/lustre/snmp/mibs' >>lustre.files
+fi
+
 %files -f lustre.files
 
 %files modules