Hi All,

I am using Net-SNMP-5.1.1. I have written an AgentX subagent in C++. This
subagent utilizes the delegated cache because it may take some time to get the
actual value to fill in the response.

I have written a small test program to show the error I am seeing. Basically if
I don't use the delegated flag and cache (return the answer in the request
handler) then it works fine. If I set the delegated flag to 1 and create a cache
for later use it failes. Here is the output of two runs of my test program.

RUN 1
----------
SUBAGENT:
[EMAIL PROTECTED] code]# ./snmpSubAgent

SNMP QUERY:
[EMAIL PROTECTED] bin]# 
snmpwalk -t 200 -r 0 -c public -v1 devel1 .1.3.6.1.4.1.2286.85.1.1.4.2.32.1
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.1.0 = INTEGER: 0
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.2.0 = INTEGER: 1
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.3.0 = INTEGER: 2
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.4.0 = INTEGER: 3
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.5.0 = INTEGER: 4
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.6.0 = INTEGER: 5
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.7.0 = INTEGER: 6
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.8.0 = INTEGER: 7
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.9.0 = INTEGER: 8
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.10.0 = INTEGER: 9


RUN 2
---------
SUBAGENT:
[EMAIL PROTECTED] code]# ./snmpSubAgent -delegate

SNMP QUERY:
[EMAIL PROTECTED] bin]# 
snmpwalk -t 200 -r 0 -c public -v1 devel1 .1.3.6.1.4.1.2286.85.1.1.4.2.32.1
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.2 = INTEGER: 0
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.3 = INTEGER: 1
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.4 = INTEGER: 2
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.5 = INTEGER: 3
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.6 = INTEGER: 4
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.7 = INTEGER: 5
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.8 = INTEGER: 6
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.9 = INTEGER: 7
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.10 = INTEGER: 8
SNMPv2-SMI::enterprises.2286.85.1.1.4.2.32.1.11 = INTEGER: 9


RUN 1 answers in the handler (no delegate or cache) and RUN 2 delegates for
later. RUN 1 returns the correct oids and values while RUN 2 misses 32.1.2 and
doesn't have the .0 on any of the responses.

I have done some testing and found that when I create the cache using
netsnmp_create_delegated_cache the oid is correct (for instance
.1.3.6.1.4.1.2286.85.1.1.4.2.32.1.1.0). But, when I get the cache later the oid
is .1.3.6.1.4.1.2286.85.1.1.4.2.32.1.2

I have looked all over the code to find where this cache may be getting
overwritten, I can't seem to find it. Can someone who may know this code a bit
better point in the direction to fix this problem?

I can send my test program if anyone is interested, it is very small.

Thanks

 Glenn 


Glenn MacGregor
HighStreet Networks

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to