0

Hello Everyone!! I have a sample code to access some information of device using snmp4j in SNMP protocol...In the sample code they have given to dump the information retrieved into some target address and i am not getting what target address is this ...

Below is my code...

 /**
 * This method returns a Target, which contains information about where the
 * data should be fetched and how.
 *
 * @return
 */
private Target getTarget() {
    Address targetAddress = GenericAddress.parse(address);
    CommunityTarget target = new CommunityTarget();
    target.setCommunity(new OctetString("public"));
    target.setAddress(targetAddress);
    target.setRetries(2);
    target.setTimeout(1500);
    target.setVersion(SnmpConstants.version2c);
    return target;
}

}

And this method has been called by Get method of ResponseEvent return type...

vikas
  • 339
  • 2
  • 6
  • 12

1 Answers1

0

It's just the IP address of the device from whom you want to retrieve some SNMP information. You can write it like this "udp:127.0.0.1/161"

Here is an example of a simple SNMP Client with snmp4j

jacen44
  • 168
  • 3
  • 18