Hi,
I'm having the same problem when registring to the sysORTable from the
example demon from the subagent tutorial.
http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demon/index.html
Should I use register_sysORTable() in the subagent to register to the
masters sysORTable or should I use some other function to trigger the
callback functionality?
This is what i've added to the init_nstAgentSubagentObject() function:
void
init_nstAgentSubagentObject(void)
{
static oid nstAgentSubagentObject_oid[] =
{ 1, 3, 6, 1, 4, 1, 8072, 2, 4, 1, 1, 2, 0 };
/*
* a debugging statement. Run the agent with -DnstAgentSubagentObject
to see
* the output of this debugging statement.
*/
DEBUGMSGTL(("nstAgentSubagentObject",
"Initializing the nstAgentSubagentObject module\n"));
/*
* the line below registers our variables defined above as
* accessible and makes it writable. A read only version of any
* of these registration would merely call
* register_read_only_int_instance() instead. The functions
* called below should be consistent with your MIB, however.
*
* If we wanted a callback when the value was retrieved or set
* (even though the details of doing this are handled for you),
* you could change the NULL pointer below to a valid handler
* function.
*/
DEBUGMSGTL(("nstAgentSubagentObject",
"Initalizing nstAgentSubagentObject scalar integer. Default
value = %d\n",
nstAgentSubagentObject));
netsnmp_register_int_instance("nstAgentSubagentObject",
nstAgentSubagentObject_oid,
OID_LENGTH(nstAgentSubagentObject_oid),
&nstAgentSubagentObject, NULL);
DEBUGMSGTL(("nstAgentSubagentObject",
"Done initalizing nstAgentSubagentObject module\n"));
/* register compliance in sysORTable */
{
register_sysORTable(nstAgentSubagentObject_oid,
OID_LENGTH(nstAgentSubagentObject_oid),
"nstAgentSubagentObject");
}
}
On Thu, Jun 12, 2008 at 5:15 PM, Göran Hillebrink <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm ugrading from ucd-snmp 4.2.3 to net-snmp 5.4.2.pre1 and has
> successfully cross-compiled it.
>
> My target system uses a agent and a subagent and I can't fetch data(from my
> registred mib) from the subagent. I've kept the old API.
> When i add the MIB used in the subagent to sysORTable everything seems okay
> but the MIB OID doesn't end up in the sysORTable as it did in ucd-snmp. I've
> added some debug info inte the register_sysORTable and that function returns
> that everything is okay(SYS_ORTABLE_REGISTERED_OK).
>
> I also started the snmpd with -DALL and the log didn't show any call to
> register_sysORTable except for the default MIBs call.
>
> Anyone got register_sysORTable working with subagents? How can I proceed to
> find out what's wrong?
>
> And another show question:
> Where can i read what different debuginformation i can turn on with the -D
> option. I only know about -DALL.
>
> Regards,
> Goran
>
>
>
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
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