From owner-freebsd-questions@FreeBSD.ORG Wed Oct 17 19:21:28 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32DDC16A473 for ; Wed, 17 Oct 2007 19:21:28 +0000 (UTC) (envelope-from lists@qwirky.net) Received: from public.aci.on.ca (mailbox.aci.on.ca [205.207.148.251]) by mx1.freebsd.org (Postfix) with ESMTP id 0120213C4B3 for ; Wed, 17 Oct 2007 19:21:27 +0000 (UTC) (envelope-from lists@qwirky.net) Received: from (invalid client hostname: host address literal does not match remote client address)[127.0.0.1] ((no PTR matching greeting name)xtreme-13-162.dyn.aci.on.ca[69.17.172.162] port=3964) by public.aci.on.ca([205.207.148.251] port=25) via TCP with esmtp (4412 bytes) (sender: ) id for ; Wed, 17 Oct 2007 15:21:17 -0400 (EDT) (Smail-3.2.0.122-Pre 2005-Nov-17 #1 built 2007-Apr-30) Message-ID: <4716610F.7090302@qwirky.net> Date: Wed, 17 Oct 2007 15:22:55 -0400 From: Jeff Royle User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Hartmut Brandt References: <47161438.3030109@qwirky.net> <20071017173108.E80702@knop-beagle.kn.op.dlr.de> In-Reply-To: <20071017173108.E80702@knop-beagle.kn.op.dlr.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000782-1, 17/10/2007), Outbound message X-Antivirus-Status: Clean Cc: FreeBSD-Questions Subject: Re: FreeBSD 6.2 + my gensnmptree issue X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: lists@qwirky.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2007 19:21:28 -0000 Hartmut Brandt wrote: > On Wed, 17 Oct 2007, Jeff Royle wrote: > > JR>I am having an issue which is most likely my lack of understanding and not a > JR>problem with 6.2 itself. > JR> > JR>The system is running 6.2-RELEASE and I use bsnmpd. Here is the uname > JR>output. > JR> > JR>FreeBSD lucky.orisit 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Wed Oct 10 10:40:51 > JR>EDT 2007 > JR> > JR>What I am trying to do is get bsnmp to respond to new MIBs, specifically > JR>UCD-SNMP-MIB. > JR> > JR>After reading the manpages for bsnmp and gensnmptree I believe gensnmptree is > JR>the command I need to use. > JR> > JR>This is where I get into trouble. The gensnmptree command doesn't give me > JR>any results no matter what I do. Even using a bug report example of > JR>gensnmptree -e sysName gives me no results. > JR> > JR>So I proceeded to do some more google searching and noticed gensnmpdef was > JR>referenced several times as the program which may be what I need to use. > JR> > JR>I found the code for this in /usr/src/contrib/bsnmp/gensnmpdef without a > JR>makefile. There is no gensnmpdef in /usr/sbin on the system but it is in > JR>the /usr/ports/net-mgt/bsnmpd/pkg-plist. > JR> > JR>So I guess I need some guidance. Can I use gensnmptree to get this MIB into > JR>the bsnmp system? If so how is this done? -or- Is there a problem with the > JR>6.2 release for gensnmpdef and that is in fact the program I am suppose to be > JR>using? > JR> > JR>Any assistance would be appreciated. > > Well, yes that would be the tool, but things are more complicated. BSNMP > uses a special file format (the .def files) to automatically create some > tables and #defines when you implement a MIB. If you invent your own MIB, > you normally write the .def file from scratch. It basically contains the > same info as the MIB file, but in a less baroque and more machine-parsable > format. If you're going to implement a MIB for which you already have a > MIB file you can shorten the time to write the .def file by feeding the > MIB file into gensnmpdef. It will create you an initial .def file, which, > in most cases, you have to edit, though. > But having the .def file is only the start of implementing. Because then > you must write the action routines that actually implement the MIB > behaviour. You might look under /usr/src/contrib/bsnmp/snmp_mibII. Here > you find an example .def file the contents of which you might find > familiar. The .c files there implement the semantic of the standard MIB-2. > > gensnmpdef is not built automatically, because it requires libsmi which > you need to install from ports. > This explains much about what I was confused with. Thank you for the quick response. It was fairly simple to get the port installed and get /usr/src/contrib/bsnmp/gensnmpdef compiled and installed. From there I went and built my ucd_tree.def file using gensnmpdef which I had to edit as you said. I see after doing this and looking into the examples you suggested this would be a bit more involved then I initially thought. I was able to generate some .c/.h files using gensnmptree but from there the legwork goes beyond me a bit. Looks like I have to look into this deeper. I do have one remaining question. How is the gensnmptree -l command used exactly? Something like cat ucd_tree.c | gensnmptree -l ?