I create an snmp message (SNMP4J) and I need to set the Read Community Public and the Write Community Private.
From an example the community is set:
// Specify receiver
Address targetaddress = new UdpAddress("10.10.10.10/162");
CommunityTarget target = new CommunityTarget();
target.setCommunity(new OctetString("public"));
target.setVersion(SnmpConstants.version2c);
target.setAddress(targetaddress);
But this doesn't specify if it is the write or read community. Is there no way to define them seperatly?
No,community string are like password, read only community string and read/write community string gives you different access for the device. If you only want to get the value from the device,you use the read only community, if you not only want to get the value and also want to change the value, you must use the read/write community. SNMP4j did not know what kind of the access you want, so it left the choice to you, you cannot set them both.