Thats correct, its the netsnmp_register_scalar which returns -1. Function
netsnmp_create_handler_registration returns a pointer to an
netsnmp_handler_registration. 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. My hypothesis is that perhaps it doesn't create an unique handler
for each scalar.
Could I create an netsnmp_handler_registration without the helper-function
netsnmp_create_handler_registration? Perhaps that would solve the problem.
Packaged dump output. Doesn't look like have any information about the scalar
registration as I can see.
dumph_send: AgentX Header
dumpx_send: 01 03 00 00
dumpv_send: Version: 1
dumpv_send: Command: 3 (Register)
dumpv_send: Flags: 00
dumph_send: Session ID
dumpx_send: 1B 00 00 00
dumpv_send: Integer: 27 (0x1B)
dumph_send: Transaction ID
dumpx_send: 00 00 00 00
dumpv_send: Integer: 0 (0x00)
dumph_send: Request ID
dumpx_send: C1 E5 31 3A
dumpv_send: Integer: 976348609 (0x3A31E5C1)
dumph_send: Dummy Length :-(
dumpx_send: 00 00 00 00
dumpv_send: Integer: 0 (0x00)
dumph_send: AgentX Payload
dumph_send: (Un)Register Header
dumpx_send: 00 7F 00 00
dumpv_send: Timeout: 0
dumpv_send: Priority: 127
dumpv_send: Range SubID: 0
dumph_send: (Un)Register Prefix
dumpv_send: OID: iso
dumph_send: OID Header
dumpx_send: 01 00 00 00
dumpv_send: # subids: 1 (0x01)
dumpv_send: prefix: 0 (0x00)
dumpv_send: inclusive: 0 (0x00)
dumph_send: OID Segments
dumpx_send: 01 00 00 00
dumpv_send: Integer: 1 (0x01)
dumpx_send:0C 00 00 00
dumpv_send: Integer: 12 (0x0C)
dumpx_recv:14 00 00 00
dumpv_recv: Integer: 20 (0x14)
dumph_recv: AgentX Header
dumph_recv: Version
dumpx_recv: 01
dumpv_recv: Version: 1
dumph_recv: Command
dumpx_recv: 12
dumpv_recv: Command: 18 (Response)
dumph_recv: Flags
dumpx_recv: 00
dumpv_recv: Flags: 0x0
dumph_recv: Reserved Byte
dumpx_recv: 00
dumpv_recv: Reserved: 0x0
dumph_recv: Session ID
dumpx_recv: 1B 00 00 00
dumpv_recv: Integer: 27 (0x1B)
dumph_recv: Transaction ID
dumpx_recv: 00 00 00 00
dumpv_recv: Integer: 0 (0x00)
dumph_recv: Packet ID
dumpx_recv: C1 E5 31 3A
dumpv_recv: Integer: 976348609 (0x3A31E5C1)
dumph_recv: Payload Length
dumpx_recv: 14 00 00 00
dumpv_recv: Integer: 20 (0x14)
dumph_recv: PDU
dumpx_recv: 7D EE 0D 00
dumpv_recv: Integer: 913021 (0xDEE7D)
dumpx_recv: 00 00
dumpv_recv: Short: 0 (0x00)
dumpx_recv: 00 00
dumpv_recv: Short: 0 (0x00)
dumph_recv: VarBindList
dumph_recv: VarBind:
dumph_recv: Type
dumpx_recv: 05 00
dumpv_recv: Short: 5 (0x05)
dumph_recv: OID Header
dumpx_recv: 01 00 00 00
dumpv_recv: # subids: 1 (0x01)
dumpv_recv: prefix: 0 (0x00)
dumpv_recv: inclusive: 0 (0x00)
dumph_recv: OID Segments
dumpx_recv: 01 00 00 00
dumpv_recv: Integer: 1 (0x01)
dumpv_recv: OID: iso
----- 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: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 call
> netsnmp_register_scalar(handler), it returns -1 which is
> MIB_DUPLICATE_REGISTRATION.
So the 'netsnmp_create_handler_registration' call succeeds
(returns a non-null value), but the 'netsnmp_register_scalar'
call fails (returns -1) - correct?
> How do I "Turn on packet dumps in the AgentX subagent" ?
Either
netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
NETSNMP_DS_LIB_DUMP_PACKET,
++snmp_dump_packet);
or
debug_register_tokens("dump");
snmp_set_do_debugging(1);
Put one or other of these statements into the main block of your
subagent code - before the 'init_snmp' and similar setup.
The first will turn on raw packet dumps (which are more compact,
but less immediately meaningful). The second enables "parsed
dumps" which are probably easier to follow, if a little verbose.
If you're not sure what you are seeing, post the text of these dumps,
together with what you think the OIDs being registered should be.
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.
------------------------------------------------------------------------------
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