Re: Agent Address in Trap Message is not as expected

Bill Fenner <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On Jan 14, 2012, at 4:02 AM, Dave Shield <[email protected]> wrote:

> On 11 January 2012 09:13,  <[email protected]> wrote:
>> It is found that NET-SNMP Agent sets the first UP and RUNNING interface IP
>> address as the AgentAddress in the trap message send from the Agent to the
>> SystemManager, instead of the IP address of the actual interface that is
>> connected to the SystemManager.
> 
>   [snip]
> 
>> snmptrapd (NET-SNMP Version:  5.3.1) captures the trap message send from the
>> Agent to the SystemManager using the below command. snmptrapd runs on the
>> monitoring machine, for e.g SystemManager.
> 
> Which version of snmpd are you using?
> If that is also 5.3.1, can you please try with the current version.
> 
> I've a feeling that this behaviour has been addressed sometime in the last
> few years, so you might find a newer version of the agent works better.

No, it still uses get_myaddr(), which really inefficiently discovers the first up interface.

There's a really nice trick (open a UDP socket, connect() it, then use getsockname() ) to figure out the outgoing address, but I couldn't figure out how to fit that in with the transport abstraction -- who says the transport even has an IP address?

You can set the address explicitly with the following lines in snmpd.conf:


[snmp] clientaddr x.x.x.x:0
v1trapaddress x.x.x.x

(The second one is obviously only relevant to SNMPv1 traps, but that is also the code that uses get_myaddr().)

  Bill

> 
> Dave
> 
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Mar 27 - Feb 2
> Save $400 by Jan. 27
> Register now!
> http://p.sf.net/sfu/rsa-sfdev2dev2
> _______________________________________________
> 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

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.