*BSD News Article 36532


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!gmi!zombie.ncsc.mil!MathWorks.Com!europa.eng.gtefsd.com!newsxfer.itd.umich.edu!nntp.cs.ubc.ca!cs.ubc.ca!frood.nsg.bc.ca!coatta
From: coatta@frood.nsg.bc.ca (Terry Coatta)
Newsgroups: comp.os.386bsd.apps
Subject: CMU SNMP
Followup-To: comp.os.386bsd.apps
Date: 4 Oct 1994 18:01:36 GMT
Organization: NSG Network Software Group
Lines: 54
Distribution: world
Message-ID: <36s5a0$o2i@cs.ubc.ca>
NNTP-Posting-Host: coatta.home.cs.ubc.ca

Anybody have much experience with running the CMU SNMP stuff under FreeBSD
(V 1.1.5)?

I have the port done by mark tinguely.  It compiles nicely, but I have had
various trouble getting it going reasonably well.  Caveat: I'm working with
SNMP V1 at the moment because I haven't read enough of Rose's book to figure
out how to set up all the config files for V2.

So... snmpget works for me no problem.  I'm having trouble with snmpwalk
though.  I issue a command like:

    snmpwalk -v 1 localhost public system

My understanding is that this should return the values for the variables
of the MIB rooted at ``system'' (e.g., things like system.sysDescr.0)

What actually happens is that the daemon exits with an error condition
in kllokup().  The problem appears to be caused by the agent attempting to
read variables from the ``at'' group.  Specifically it is trying to read the
ARP table and I don't believe that there is such a thing on my machine as
I am not networked (and I do *not* have the pseudo-device ether configured 
for my kernel).

I've run the daemon under gdb and had a look at what is happening, and
I cannot see where in the code it would check to see that it has fetched 
a complete sub-tree and thus knows that it should return that information
to the client.  In fact, the routine bulk_var_op_list() (which seems to
be responsible for handling the request from snmpwalk) just seems to
loop for a predetermined number of iterations (passed in as a parameter)...
Here is the code:

    for(repeatCount = 1; repeatCount < max_repetitions; repeatCount++){
      ...
      statP = getStatPtr(rl->name, &rl->length, &statType, &statLen,
			 &acl, FALSE, &write_method, pi, &noSuchObject);
      ...
    }

The getStatPtr() routine modifies rl so that it names the next variable
out fo the MIB, and the loop just goes on merrily grabbing their values.
In the particular runs which I have traced, the values of max_repetitions
is 1000, so it tries to fetch quite a bit.  In may case, it dies before it
can finish due to the problem with the ARP table.

I have also tried to use snmpwalk on some daemons running at other sites
and I simply get no response.  I can however, fetch particular variables
using snmpget.

-- 
** Terry Coatta
** NSG Network Software Group, Inc.
** 211 Douglas Cres. Richmond B.C. V7B 1E4
** Tel: (604) 273-3404
** E-mail: coatta@nsg.bc.ca