Re: Hostname vs. IP sent in traps

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 22/05/07, David Arthur <[email protected]> wrote:
> I use the send_v2trap function to send traps from the embedded subagent.
> 1) Is there a way to send a hostname (rather than IP address) using the
> snmp_varlist_add_variable()/send_v2trap() scheme?

You can append whatever varbinds you like to the payload of the trap.
This could potentially include a string varbind, containing the hostname.
But always ensure that the varbinds listed in the MIB definition for the
trap come first.


> 2) If I use the snmptrap command and specify the hostname I am sending it
> from, the IP address always appears at the management station end. Is this
> behavior determined by the management station, or is the hostname resolved
> to an IP and *then* sent in the trap?

The standard structure of an SNMPv1 trap includes a field for the IP address.
SNMPv2-style traps don't necessarily include this value, but there is a
standard varbind defined for it.
  But in both cases, this is an IP address, not a hostname.  So yes, typically
the hostname will be resolved first, and this IP address then sent in the trap.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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.