Howdy,

I have encountered a bizarre issue where a number of UDP and TCP
counters are returning zero (kstat shows non-zero values for
udpInDatagrams, so I know the values shouldn't be zero):

$ /usr/sfw/bin/snmpwalk -c public -v 2c host udpInDatagrams.0
UDP-MIB::udpInDatagrams.0 = Counter32: 0

This appears to match up with the following post (which doesn't appear
to have a resolution):

http://sourceforge.net/mailarchive/forum.php?thread_name=F26A9AA488D81043AD772F8CF14370AF272E700A%40triton.mii-us.mirrorimage.net&forum_name=net-snmp-users

I enabled debugging, and see the following when I request the
udpInDatagrams OID:

Received SNMP packet(s) from UDP: [0.0.0.0]->[10.18.34.102]:-14599
  GETNEXT message
    -- UDP-MIB::udpInDatagrams
kernel_sunos5: getMibstat (10, *, 40, 0, *, *)
kernel_sunos5: ... cache_valid 0 time 0 ttl 30 now 1239840358
kernel_sunos5: ...... getmib (263, 0, ...)
kernel_sunos5:dlpi: calling getentry after getmsg: req_type: 0, buf:
24, entrysize: 40
kernel_sunos5: bad cache length 24 - not multiple of entry size 40
kernel_sunos5: ...... getmib returns 2
kernel_sunos5: ... result 1 rc 2
kernel_sunos5: ... getMibstat returns 1
mibII/udpScalar: getMibstat call from udp_load : MIB_UDP 10,
sizeof(mib2_udp_t): 40
mibII/udpScalar: Loaded UDP scalar Group (solaris)
mibII/udpScalar: Handler - mode GETmibII/udpScalar: oid:
UDP-MIB::udpInDatagrams.0
Received SNMP packet(s) from UDP: [0.0.0.0]->[10.18.34.102]:-14599

I noticed that a "bad cache length" is returned in each case, and that
appears to come from the getentry() routine in kernel_sunos5.c. I
added a bit of extra code to the calling function, and  it appears the
size of the buf returned from the getmsg() call in the following code
block has a buffer length of 24-bytes instead of 40-bytes:

strbuf.buf = statbuf;
strbuf.maxlen = size;
strbuf.len = 0;
flags = 0;
do {
    rc = getmsg(sd, NULL, &strbuf, &flags);

    .....

    DEBUGMSGTL(("kernel_sunos5", "calling getentry after getmsg:
req_type: %d, buf: %d, entrysize: %d\n",
                req_type, strbuf.len, entrysize));

    result = getentry(req_type, (void *) strbuf.buf, strbuf.len,
                      entrysize, resp, comp, arg);
    *length = strbuf.len;           /* To use in caller for cacheing */
    break;
}

kernel_sunos5:dlpi: calling getentry after getmsg: req_type: 0, buf:
24, entrysize: 40

I poked around the code, and it looks like the sizeof a mib2_udp
structure (this is part of inet/mib2.h on Solaris hosts) is 24-bytes
when NEW_MIB_COMPLIANT is not defined, and 40-bytes with it is
defined. Is it possible that the msgbuf returned from the kernel isn't
returning the udpHCInDatagrams and udpHCOutDatagrams counters
(16-bytes worth of data) that were added as part of the
NEW_MIB_COMPLIANT change (I will create a streams device to test this
weekend, but was curious if someone happened to know)? I still have
some debugging to do, but thought I would ask the folks on the list to
see if anyone had any ideas. I am using Solaris 10 update 6 with the
latest patch bundle.

Thanks,
- Ryan
--
http://prefetch.net

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to