Bug 158924

Summary: Agentx Context Name Registration
Product: [Fedora] Fedora Reporter: W Raul S <piqued>
Component: net-snmpAssignee: Radek Vokál <rvokal>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: net-snmp-5.2.2-0.rc3.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-11-01 13:41:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description W Raul S 2005-05-26 21:06:37 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.0.4-1.3.1 Firefox/1.0.4

Description of problem:
No entries/values are reported for a table (ex. netSnmpHostsTable) when the table is connected through a sub-agent registered with a contextName.  

Using a Net-Snmp example table, netSnmpHostsTable, and the most basic sub-agent wrapping demon (from http://www.net-snmp.org/tutorial/tutorial-5/toolkit/index.html) no results are queriable unless the context is is set to null or "" (no context). 

The current 5.2.1-1.tar.gz source-forge source release also has this problem. The current cvs version does not have this problem. 

Without the context specified, the mib reports the table entries correctly.

To specify the registration handler's contextName:
   ...
   netsnmp_handler_registration *my_handler;
   my_handler->contextName = strdup ( "contextName" );   ...


Version-Release number of selected component (if applicable):
net-snmp-5.2.1-12

How reproducible:
Always

Steps to Reproduce:
1. snmpd -f -Lo -c /usr/share/snmp/snmpd.conf 
2. ./hostsTable-demon
3. snmptable -v3 -u raul -n "contextName" -l authNoPriv -a MD5 -x DES -A myPassword localhost NET-SNMP-EXAMPLES-MIB::netSnmpHostsTable -Ci -Cl

  

Actual Results:  NET-SNMP-EXAMPLES-MIB::netSnmpHostsTable: No entries

Expected Results:  SNMP table: NET-SNMP-EXAMPLES-MIB::netSnmpHostsTable

index                   netSnmpHostAddressType netSnmpHostAddress netSnmpHostStorage netSnmpHostRowStatus 
"localhost.localdomain" ipv4                   "7F 00 00 01 "     nonVolatile        active        

Additional info:

With added debugging comments to the library code, the fn int
netsnmp_register_mib(const char *moduleName,
                     struct variable *var,
                     size_t varsize,
                     size_t numvars,
                     oid * mibloc,
                     size_t mibloclen,
                     int priority,
                     int range_subid,
                     oid range_ubound,
                     netsnmp_session * ss,
                     const char *context,
                     int timeout,
                     int flags,
                     netsnmp_handler_registration *reginfo,
                     int perform_callback)

recieves the correct contextName. This occurs within the master agent, but there is no call to register_mib_context() or other context registration etc.

Comment 1 Radek Vokál 2005-11-01 13:41:41 UTC
I've updated rawhide to net-snmp-5.2.2.rc3. This issue should be gone now.