Problem with Agentx implementation

<[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
We downloaded the agentx sample code from the following link. 

http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/demon/index.
html 

The example-demon ( target of the makefile) calls
init_nstAgentSubagentObject() which is defined in
nstAgentSubagentObject.c . 

We are facing following two issues.

1. In the init_nstAgentSubagentObject() function we changed the oid in
above example to static oid nstAgentSubagentObject_oid[] { 1, 3, 6, 1,
2, 1, 1, 7, 0 }; 

and it worked. Here we have registered one oid. But the problem is that
we are unable to find a api which will register all the oids , given a
base oid. 

Right now if we have to register 7 oids thenn we will have to call the
same netsnmp_register_int_instance() 7 times with respective static 

nstAgentSubagentObject_oid values. 

2. We tried calling our own function for snmpget by modifying the
function call as follows 

netsnmp_register_int_instance("nstAgentSubagentObject",
nstAgentSubagentObject_oid, OID_LENGTH(nstAgentSubagentObject_oid),
&nstAgentSubagentObject, myFunctionHandler); 

The definition of myFunctionHandler is as follows: 

void myFunctionHandler()
{
nstAgentSubagentObject = 6; 

return;
} 

This calls our function without any issues. But the problem is when we
do snmpget -c pulic 10.101.65.108 1.3.6.1.2.1.1.7.0 

the value returned is 2 and second time onwards the value returned is 6.
But it enters out function all the time. 

Still the value displayed the first time is 2. 

Can anyone suggest a solution for this??

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.