[AGENT++] Double traps received at snmptrapd / unhandled AGENTX_NOTIFY_PDU

Razvan Cojocaru razvan.cojocaru at kaspersky.ro
Tue Apr 17 11:14:46 CEST 2007


Hello.

I've dug deeper into the Net-SNMP/AgentX++ traps issue I'm having (which
is: for every trap I send with SubAgentXMib::notify(), I get two of them
in snmptrapd).

My setup is: AgentX++ subagent, connected via an UNIX socket with snmpd
(from Net-SNMP), which acts as a master agent. Then I start snmptrapd as
'snmptrapd -f -Le', and send a trap with notify().

I've tried to use subagent2 from agentX++/examples/subagent, and here's
the log (I've added a line of my own, so that you can see which request
is unhandled):

20070417.12:05:32: 18833: (2)EVENT  : AgentXSlave: sending notify PDU
(trap): (1.3.6.1.6.3.1.1.4.1.0)
20070417.12:05:32: 18833: (3)EVENT  : AgentX: sending agentx pdu
(sd)(type)(sid)(tid)(pid)(err)(errind): (5), (12), (31), (9), (11), (0), (0)
20070417.12:05:32: 18825: (4)DEBUG  : AgentXSlave: received something on
ports
20070417.12:05:32: 18825: (2)EVENT  : AgentXRequestList: request
received (context)(tid)(pid)(siz)(type)(err)(status): (), (9), (11),
(2), (18), (0), (0)
20070417.12:05:32: 18825: (1)DEBUG  : TaskManager: task manager found
20070417.12:05:32: 18825: (2)DEBUG  : TaskManager: after notify
20070417.12:05:32: 18829: (2)EVENT  : SubAgent: starting thread execution
20070417.12:05:32: 18829: (1)DEBUG  : TaskManager: task manager found
20070417.12:05:32: 18827: (2)INFO   : SubAgentXMib:
pending->get_agentx_type(): : (12)
20070417.12:05:32: 18827: (1)DEBUG  : SubAgentXMib: unhandled response
(tid)(pid): (9), (11)
20070417.12:05:32: 18829: (2)DEBUG  : TaskManager: after notify
20070417.12:05:32: 18829: (2)EVENT  : Agent: finished thread execution

So pending->get_agentx_type() is 12, which in
include/agentx_pp/agentx_def.h is #defined as AGENTX_NOTIFY_PDU.

I'm not sure that this is precisely what causes the problem. I've also
tested the subagent with the example master from
agentX++/examples/master + snmptrapd, and in that case only one trap is
being received in snmptrapd (as it should). So this only happens when
Net-SNMP's snmpd is the master agent.

The "unhandled response" issue in the logs happens with agentX++'s
example master agent as well, but it might actually matter to snmpd - I
don't know if that's the case.

Any thoughts on why this might happen? I don't mind tinkering and
patching the code, but I'd appreciate a hint :-).

Thanks.


-- 
Razvan Cojocaru
KeyID: 1024D/04CA34DE




More information about the AGENTPP mailing list