Host Name

 

In principle, there is no way to automatically discover the SNMP agent enabled nodes or devices. The management applications must be explicitly told where the agents reside. This can be the network address or the host name of the node in which the agent is installed. The management applications normally provide options to select the agent by entering the host name manually, selecting from a list of devices, or by clicking from a network topology map.

 

Applications use the host name or the IP address of the device to communicate with the agent of the device.

 

The following table lists the methods to be used for setting the host name parameters.

 

API Name Class / Component Name API Methods Remarks

High-Level

SnmpTarget
SnmpRequestServer
SnmpPoller
SnmpTable

setTargetHost(String)

Here the String can be either the hostname, including fully qualified DNS hostname or IP address in string format, such as "192.168.1.4".

Low-Level

UDPProtocolOptions

setRemoteAddress(InetAddress)

setRemoteHost(String)

The String can be hostname or IP address in the string format. The InetAddress can be the IP address.

RMI

SnmpTarget
SnmpRequestServer

setTargetHost(String)

The String can be either the hostname, including fully qualified DNS hostname or IP address in string format.

CORBA

SnmpTarget
SnmpRequestServer

setTargetHost(String)

- same as above -

EJB

SnmpTargetEJB

setTargetHost(String)

- same as above -

 

Note: In the low-level API, the remoteHost attribute of SnmpPDU overrides the peername set in SnmpSession. This means, when remoteHost is null in SnmpPDU, messages are sent to the host, peername, set in the session. When remoteHost is not null in SnmpPDU, messages are sent to the remoteHost. It is a good practice to set the peername in SnmpSession to the host with which you intend to interact more frequently. Default peername is null, meaning when both peername in session and remoteHost in PDU are null, the exception "No remote IP address specified" is thrown.



Copyright © 1996-2006, AdventNet Inc. All Rights Reserved.