On 28 October 2011 21:14, Juan Carlos Franzoy <[email protected]> wrote:
> I've configured a trapsink in snmpd.conf. As long as I understand, trapsink
> instructs snmpd to send snmpv1 traps.

Correct


> Then from an agentx connected subagent I send a trap:

OK - remember if you are sending notifications from an AgentX
subagent, then these are effectively SNMPv2 format requests.
(The AgentX notification structure is essentially the same as SNMPv2)

So the master agent is receiving an SNMPv2 format trap,
and sending it out as an SNMPv1 trap.   Hence the conversion
rules of RFC 3584, section 3.2  come into play.


>  send_enterprise_trap_vars( SNMP_TRAP_ENTERPRISESPECIFIC,
>                          44, &enterprise, enterprise_size, myvars );

Presumably this is within the AgentX subagent.
So the subagent is receiving a v1-style trap, and sending it on to the
master agent as an AgentX notification (i.e. an SNMPv2 format trap).
Hence the conversion rules of RFC 3584, section 3.1 *also*  come into play.


> With a sniffer I can see a trap with two variables bind, one is mine, I mean
> it was in 'myvars'; the other variable is SNMPv2-MIB::snmpTrapEnterprise.0.

That will probably be as a result of the AgentX subagent conversion (v1->v2)
In particular, section 3.1 step (4)  lists three additional variable bindings
which are added to the varbind list - including snmpTrapEnterprise.0.

This is *not* removed by the v2->v1 conversion  (see section 3.2)


> Surprisingly, if I compile the subagent with version 5.0.8 libraries, the
> extra variable (SNMPv2-MIB::snmpTrapEnterprise.0) is not sent.

That's probably a flaw in the 5.0.8 code.
This is a very early verison of the Net-SNMP code, and a number
of problems have been fixed since then.



> The questions are:
>   - is this variable supposed to be sent in an snmpv1 trap?

Yes - see above.

>   - what can I do to ask snmpd to avoid sending it?

The simplest approach would be to specify the notification using
SMNPv2 syntax in the AgentX subagent.  (i.e. 'send_v2trap')
That would avoid the v1->v2 conversion that adds this particular varbind.

The trap would still be converted v2->v1 by the master agent,
and sent out as an SNMPv1 trap - but without these extra varbinds.

Dave

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
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

Reply via email to