[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

8628.0. "SNMP traps - how do you specify agent address ?" by CHEFS::THORP_A (ANDREW THORP) Wed Jan 29 1997 06:01

I'd like to develop a utility which can send SNMP traps whereby the agent
address (address of object generating the trap) is not always the address of
the machine where the utility is running. So far I've used trapsend to send
traps, but this doesn't allow you to specify the agent address (just the
destination address).

I've also looked through the eSNMP documentation and it seems the esnmp_trap()
call has the same restriction.

Does anyone know of any APIs / utilities which allow you to generate SNMP
traps where you can specify both the agent address (and preferably the
destination address) each time you generate an SNMP trap ? Is there a set of
low level eSNMP routines which I could use for this purpose ?

BTW I get the impression from looking through RFC 1157 that the agent
address is stored in the SNMP Trap-PDU. As the destination address isn't
mentioned I assume its stored in the IP layer. Can anyone confirm this ?

Thanks in advance,

Andy

T.RTitleUserPersonal
Name
DateLines
8628.1snmp_trapsndSMURF::DANIELEWed Jan 29 1997 14:0245
Hi Andy,

>I'd like to develop a utility which can send SNMP traps whereby the agent
>address (address of object generating the trap) is not always the address of
>the machine where the utility is running. So far I've used trapsend to send
>traps, but this doesn't allow you to specify the agent address (just the
>destination address).

I'm not familiar with "trapsend".

>I've also looked through the eSNMP documentation and it seems the esnmp_trap()
>call has the same restriction.

Correct.  It made sense to so limit traps emitted from the extensible
agent.

>Does anyone know of any APIs / utilities which allow you to generate SNMP
>traps where you can specify both the agent address (and preferably the
>destination address) each time you generate an SNMP trap ? Is there a set of
>low level eSNMP routines which I could use for this purpose ?

A new command called snmp_trapsnd will be shipping as part of Steel.

#snmp_trapsnd enterprise agent-address generic specific timeticks
[-v version] [-c comm] [-h host] [-p port] [-tcp] {variable [type value]}

It supports SNMPv2C as well as SNMPv1, and the `agent-address' argument
is what you are looking for specifically.

The code is written, if you need an early copy let me know.

>BTW I get the impression from looking through RFC 1157 that the agent
>address is stored in the SNMP Trap-PDU. As the destination address isn't
>mentioned I assume its stored in the IP layer. Can anyone confirm this ?

Yes, the SNMPv1-Trap-PDU contains the agent address.  The destination address
is never contained in any SNMP message, it's specified when you send the
message, by whatever mechanism you use (for example, sendto()).  
So yes, it's "stored" in the IP layer (it's in the IP datagram).

Note that the agent-address was removed from the SNMPv2-Trap-PDU
(see RFC 1905).

Regards,
Mike