Re: Debugging SNMP

2012-10-29 Thread Sverre Moe
is unique. So why does it returns MIB_DUPLICATE_REGISTRATION? /Sverre - Original Message - Fra: Dave Shield d.t.shi...@liverpool.ac.uk Til: Sverre Moe sve...@spacetec.no Kopi: net-snmp-users net-snmp-users@lists.sourceforge.net Sendt: 26. oktober 2012 14:52:18 Emne: Re: Debugging SNMP

Re: Debugging SNMP

2012-10-29 Thread Sverre Moe
Emne: RE: Debugging SNMP I don’t know in your case, but one reason is because of execution of a subagent code multiple times. So when you run your subagent with “./XXX ” make sure that the previous execution has already been stopped. And if you have compiled the code with master agent

Re: Debugging SNMP

2012-10-29 Thread Dave Shield
On 29 October 2012 09:34, Sverre Moe sve...@spacetec.no wrote: I have tried to manually register 3 hard coded scalars, one by one, each with its own handler: [snip] This works fine and snmpget returns a value. However, if I put these 3 hard coded scalars OID in a list, iterate over that

Re: Debugging SNMP

2012-10-29 Thread Sverre Moe
- Original Message - Fra: Dave Shield d.t.shi...@liverpool.ac.uk Til: Sverre Moe sve...@spacetec.no Kopi: net-snmp-users net-snmp-users@lists.sourceforge.net Sendt: 29. oktober 2012 11:01:33 Emne: Re: Debugging SNMP On 29 October 2012 09:34, Sverre Moe sve...@spacetec.no wrote: I

Re: Debugging SNMP

2012-10-29 Thread Dave Shield
On 29 October 2012 10:10, Sverre Moe sve...@spacetec.no wrote: I have tried to seperate the registration call into two separate statements, same result. None of these are actually failing. When I call netsnmp_register_scalar(handler), it returns -1 which is MIB_DUPLICATE_REGISTRATION. So the

Re: Debugging SNMP

2012-10-29 Thread Sverre Moe
net-snmp-users@lists.sourceforge.net Sendt: 29. oktober 2012 11:20:30 Emne: Re: Debugging SNMP On 29 October 2012 10:10, Sverre Moe sve...@spacetec.no wrote: I have tried to seperate the registration call into two separate statements, same result. None of these are actually failing. When I

Re: Debugging SNMP

2012-10-29 Thread Dave Shield
On 29 October 2012 10:46, Sverre Moe sve...@spacetec.no wrote: I have also tried to output the handler memory address, and its not always unique. Don't know if it has anything to do with the problem. Hmmm as far as I can tell, this structure should be unique, but this duplication could

Re: Debugging SNMP

2012-10-29 Thread Sverre Moe
Kopi: net-snmp-users net-snmp-users@lists.sourceforge.net Sendt: 29. oktober 2012 12:38:51 Emne: Re: Debugging SNMP On 29 October 2012 10:46, Sverre Moe sve...@spacetec.no wrote: I have also tried to output the handler memory address, and its not always unique. Don't know if it has anything

Re: Debugging SNMP

2012-10-29 Thread Dave Shield
On 29 October 2012 11:56, Sverre Moe sve...@spacetec.no wrote: Why does this work for my 3 hard coded scalars, but not my list of scalars? const oid scalar_oid[] = { 1,3,6,1,4,1,45678,1,1 }; OID_LENGTH(scalar_oid) gives value 9. const oid *scalar_oid = wrapper.getOid(); //Has same oid

Debugging SNMP

2012-10-26 Thread Sverre Moe
Hello, me again. Have been sending a few messages lately. Hope I am not nagging to much. Is there a way I could debug snmp. I have gotten my C++ program to work as an SNMP AgentX. I have managed to register 3 hard coded test scalars and it works when I snmpget on those scalars. Thus

Re: Debugging SNMP

2012-10-26 Thread Sverre Moe
of in groups. /Sverre - Original Message - Fra: Sverre Moe sve...@spacetec.no Til: net-snmp-users net-snmp-users@lists.sourceforge.net Sendt: 26. oktober 2012 10:19:24 Emne: Debugging SNMP Hello, me again. Have been sending a few messages lately. Hope I am not nagging to much

Re: Debugging SNMP

2012-10-26 Thread Dave Shield
On 26 October 2012 12:16, Sverre Moe sve...@spacetec.no wrote: The first scalar group I tried to register got value 0(MIB_REGISTERED_OK). All the others got value -1(MIB_REGISTRATION_FAILED or MIB_DUPLICATE_REGISTRATION). Do the other groups use the same root OID as the first

Re: Debugging SNMP

2012-10-26 Thread Dave Shield
On 26 October 2012 13:29, Sverre Moe sve...@spacetec.no wrote: Full code of my scalar registration. Changed to register all scalars one by one instead of in group. The oid_wrapper class is a wrapper around oid that contains an oid pointer and the length of that oid. Try printing out the

Re: Debugging SNMP

2012-10-26 Thread Sverre Moe
: 26. oktober 2012 14:52:18 Emne: Re: Debugging SNMP On 26 October 2012 13:29, Sverre Moe sve...@spacetec.no wrote: Full code of my scalar registration. Changed to register all scalars one by one instead of in group. The oid_wrapper class is a wrapper around oid that contains an oid pointer