|
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 |
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 |
The String can be hostname or IP address in the string format. The InetAddress can be the IP address. | |
|
RMI |
SnmpTarget |
The String can be either the hostname, including fully qualified DNS hostname or IP address in string format. | |
|
CORBA |
SnmpTarget |
- same as above - | |
|
EJB |
SnmpTargetEJB |
- 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. |
|