Subject: Re: anyone using net-snmp?
To: Dick Davies <rasputnik@hellooperator.net>
From: Greg A. Woods <woods@weird.com>
List: netbsd-users
Date: 12/08/2004 13:57:49
[ On Tuesday, December 7, 2004 at 21:46:18 (+0000), Dick Davies wrote: ]
> Subject: Re: anyone using net-snmp?
>
> Well, I did it by hand, but yeah, I setup a 'rocommunity xxx', syslocation etc.

That should suffice -- assuming it doesn't complain!  ;-)

> . Have you got 'disk bla bla' entries in yours? I just tried adding that, no 
> difference. ( I thought that was just for traps,

Yes, and yes, and I'm also pretty sure they're only useful with the
ucd-snmp-mib.

> all
> I want to do is draw some graphs of usage with cricket. )

that's what I do -- though I must admit I've not even peeked at them
lately!  ;-)


> Any chance I could have a look?

I'll send a slightly sanitized version to you directly.


Also, I seem to have the following additional file in my patches
sub-directory -- I'm not sure why any more, but it obviously doesn't
hurt, and maybe it's the secret to why it works for me:

--- include/net-snmp/utilities.h.orig	Fri Dec 20 02:35:20 2002
+++ include/net-snmp/utilities.h	Thu Oct  9 16:31:14 2003
@@ -46,4 +46,10 @@
 
 #include <net-snmp/version.h>
 
+#if defined(__NetBSD__)
+/* kvm_open() always does the "Right Thing(tm)" */
+# undef KERNEL_LOC
+# define KERNEL_LOC	((char *) NULL)
+#endif
+
 #endif                          /* NET_SNMP_UTILITIES_H */



And finally just for completeness note that I've made the following
additional changes to the pkgsrc module I build from (the patch below
includes the patches file above), and note that I'm also linking
statically (on both alpha and i386):

$ file /usr/pkg/sbin/snmp*
/usr/pkg/sbin/snmpd:     ELF 64-bit LSB executable, Alpha (unofficial), version 1 (SYSV), for NetBSD, statically linked, not stripped
/usr/pkg/sbin/snmptrapd: ELF 64-bit LSB executable, Alpha (unofficial), version 1 (SYSV), for NetBSD, statically linked, not stripped


cvs diff: Diffing net/net-snmp
Index: net/net-snmp/Makefile
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/net/net-snmp/Makefile,v
retrieving revision 1.23
diff -u -r1.23 Makefile
--- net/net-snmp/Makefile	13 Aug 2004 11:28:49 -0000	1.23
+++ net/net-snmp/Makefile	10 Sep 2004 18:10:57 -0000
@@ -18,7 +18,7 @@
 NET_SNMP_SYS_CONTACT?=		default_user@contact.domain
 NET_SNMP_SYS_LOCATION?=		defaultlocation
 NET_SNMP_PERSISTENTDIR?=	${VARBASE}/net-snmp
-NET_SNMP_MIBDIRS?=		\$$HOME/.snmp/mibs:${PREFIX}/share/snmp/mibs:${PREFIX}/lib/tcl/tnm2.1.10/mibs:/usr/local/share/snmp/mibs
+NET_SNMP_MIBDIRS?=		\$$HOME/.snmp/mibs:${PREFIX}/share/snmp/mibs:${PREFIX}/lib/tcl/tnm2.1.10/mibs:/usr/local/share/snmp/mibs:/usr/local/lib/tnm3.0.0/mibs
 
 USE_BUILDLINK3=		yes
 USE_LIBTOOL=		yes
@@ -32,7 +32,7 @@
 
 GNU_CONFIGURE=		yes
 
-CONFIGURE_ARGS+=	--enable-shared
+CONFIGURE_ARGS+=	--disable-shared
 # net-snmp doesn't do IPv6 on Solaris
 .if (defined(USE_INET6) && (${USE_INET6} == "YES")) && ${OPSYS} != "SunOS"
 CONFIGURE_ARGS+=	--enable-ipv6
Index: net/net-snmp/PLIST
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/net/net-snmp/PLIST,v
retrieving revision 1.8
diff -u -r1.8 PLIST
--- net/net-snmp/PLIST	13 Aug 2004 11:28:49 -0000	1.8
+++ net/net-snmp/PLIST	10 Sep 2004 18:11:07 -0000
@@ -41,6 +41,7 @@
 include/net-snmp/agent/instance.h
 include/net-snmp/agent/mib_module_config.h
 include/net-snmp/agent/mib_module_includes.h
+include/net-snmp/agent/mib_module_config.h
 include/net-snmp/agent/multiplexer.h
 include/net-snmp/agent/mode_end_call.h
 include/net-snmp/agent/net-snmp-agent-includes.h
Index: net/net-snmp/distinfo
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/net/net-snmp/distinfo,v
retrieving revision 1.12
diff -u -r1.12 distinfo
--- net/net-snmp/distinfo	13 Aug 2004 11:28:49 -0000	1.12
+++ net/net-snmp/distinfo	5 Nov 2004 01:43:37 -0000
@@ -2,6 +2,7 @@
 
 SHA1 (net-snmp-5.1.2.tar.gz) = cf82a86d1b44408890cabe471181b62049cb11d0
 Size (net-snmp-5.1.2.tar.gz) = 3253579 bytes
+SHA1 (patch-ZY) = fe381916a7cc2f3197136c58337df783b4d4d579
 SHA1 (patch-aa) = df9bcea942743e9bcd843724612b7d82ea364eca
 SHA1 (patch-ac) = 43dbf5519feac2a13b893f659090fa24de773ee8
 SHA1 (patch-ad) = 522872c90ac1e442dafb1d210af6e978ac741ce9
cvs diff: Diffing net/net-snmp/files
Index: net/net-snmp/files/snmpd.sh
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/net/net-snmp/files/snmpd.sh,v
retrieving revision 1.4
diff -u -r1.4 snmpd.sh
--- net/net-snmp/files/snmpd.sh	31 May 2004 11:47:29 -0000	1.4
+++ net/net-snmp/files/snmpd.sh	9 Sep 2004 21:18:31 -0000
@@ -1,9 +1,9 @@
-#!@RCD_SCRIPTS_SHELL@
+#! @RCD_SCRIPTS_SHELL@
 #
 # $NetBSD: snmpd.sh,v 1.4 2004/05/31 11:47:29 tron Exp $
 #
 # PROVIDE: snmpd
-# REQUIRE: DAEMON
+# REQUIRE: DAEMON snmptrapd
 
 if [ -f /etc/rc.subr ]; then
 	. /etc/rc.subr
Index: net/net-snmp/files/snmptrapd.sh
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/net/net-snmp/files/snmptrapd.sh,v
retrieving revision 1.3
diff -u -r1.3 snmptrapd.sh
--- net/net-snmp/files/snmptrapd.sh	31 May 2004 11:47:29 -0000	1.3
+++ net/net-snmp/files/snmptrapd.sh	10 Sep 2004 18:12:47 -0000
@@ -1,4 +1,4 @@
-#!@RCD_SCRIPTS_SHELL@
+#! @RCD_SCRIPTS_SHELL@
 #
 # $NetBSD: snmptrapd.sh,v 1.3 2004/05/31 11:47:29 tron Exp $
 #
cvs diff: Diffing net/net-snmp/patches
Index: net/net-snmp/patches/patch-ZY
===================================================================
RCS file: net/net-snmp/patches/patch-ZY
diff -N net/net-snmp/patches/patch-ZY
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ net/net-snmp/patches/patch-ZY	9 Oct 2003 20:53:57 -0000
@@ -0,0 +1,13 @@
+--- include/net-snmp/utilities.h.orig	Fri Dec 20 02:35:20 2002
++++ include/net-snmp/utilities.h	Thu Oct  9 16:31:14 2003
+@@ -46,4 +46,10 @@
+ 
+ #include <net-snmp/version.h>
+ 
++#if defined(__NetBSD__)
++/* kvm_open() always does the "Right Thing(tm)" */
++# undef KERNEL_LOC
++# define KERNEL_LOC	((char *) NULL)
++#endif
++
+ #endif                          /* NET_SNMP_UTILITIES_H */


-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>