I have checked and there is only once instance of my subagent running. It is 
running as a separate process using AgentX protocol.


I have tried to manually register 3 hard coded scalars, one by one, each with 
its own handler:
int returnValue1 = netsnmp_register_read_only_scalar(
netsnmp_create_handler_registration("test1",
handle_snmp,
test1_oid,
OID_LENGTH(test1_oid),
HANDLER_CAN_RONLY
));



int returnValue2 = netsnmp_register_read_only_scalar(
netsnmp_create_handler_registration("test2",
handle_snmp,
test2_oid,
OID_LENGTH(test2_oid),
HANDLER_CAN_RONLY
));

etc...



This works fine and snmpget returns a value. However , if I put these 3 hard 
coded scalars OID in a list, iterate over that list and register them, I get a 
duplicate error.

for (oid_iterator) { //Overlook pseudocode here

const oid *oid_value = (*oid_iterator);
const char *buffy = tmp_string.c_str();
int returnValue = netsnmp_register_read_only_scalar(
netsnmp_create_handler_registration(buffy,
handle_snmp,
oid_value,
OID_LENGTH(oid_value),
HANDLER_CAN_RONLY
));
}





----- Original Message -----

Fra: "Jatin Bodarya" <jatin.boda...@elitecore.com>
Til: "Sverre Moe" <sve...@spacetec.no>
Sendt: 29. oktober 2012 09:59:23
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, In that case you have to replace your “ 
libnetsnmpmibs.so.X... “ files... and then you have to execute it as subagent.



From: Sverre Moe [mailto:sve...@spacetec.no]
Sent: 29 October 2012 13:57
To: Dave Shield
Cc: net-snmp-users
Subject: Re: Debugging SNMP


I have checked the contents of each elements inputted into
int returnValue = netsnmp_register_read_only_scalar(
netsnmp_create_handler_registration(buffy,
handle_snmp,
scalar_oid,
OID_LENGTH(scalar_oid),
HANDLER_CAN_RONLY
));

For each iteration of the loop the OID and scalar name 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

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 value of 'scalar_oid' (and 'scalar_length')
each time round the loop.
What is the registration call *actually* being invoked with?
(as opposed to what you think it _should_ be invoked with)

Dave



CONFIDENTIALITY This e-mail and any attachment contain KONGSBERG information 
which may be proprietary, confidential or subject to export regulations, and is 
only meant for the intended recipient(s). Any disclosure, copying, distribution 
or use is prohibited, if not otherwise explicitly agreed with KONGSBERG. If 
received in error, please delete it immediately from your system and notify the 
sender properly.





CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which may be
proprietary, confidential or subject to export regulations, and is only meant
for the intended recipient(s). Any disclosure, copying, distribution or use is
prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in
error, please delete it immediately from your system and notify the sender
properly.
------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to