|
The three versions of SNMP that are in use are SNMPv1, SNMPv2c, and SNMPv3. If the SNMP version is not explicitly set, the default version is taken as SNMPv1. To set the specific SNMP version, we need to use the following methods listed in the table. The value 1 is for SNMPv2c.
| API Name |
Class/Component Name |
API Methods |
Remarks |
|---|---|---|---|
|
High-Level |
SnmpTarget |
Apart from this method, the static constants VERSION1, VERSION2c, and VERSION3 available in the bean can also be used to set the SNMP versions. | |
|
Low-Level |
SnmpSession |
This method sets the default version for the messages sent using this session. Both session and the PDU objects are created with a default version SNMPv1. | |
|
RMI |
SnmpTarget |
This method sets the SNMP version | |
|
CORBA |
SnmpTarget |
- same as above - | |
|
EJB |
SnmpTargetEJB |
- same as above - |
|
|
Warning: When an application sends an SNMPv1 PDU using a session whose version is set to SNMP_VERSION_3, a SNMPv3 message is sent to the peer. This problem arises because the API uses SNMP_VERSION_1 as the default PDU version and it could not distinguish between applications leaving the version in PDU to default and setting it explicitly to SNMP_VERSION_1. To circumvent this problem, applications should set session version to SNMP_VERSION_1 and set the PDU version explicitly to SNMP_VERSION_2C or SNMP_VERSION_3 while communicating with v2c and v3 peers. |
|