OctetString community1 = new OctetString(community);
String host = ipAddress + "/" + port;
Address tHost = new UdpAddress(host);
TransportMapping transport = new DefaultUdpTransportMapping();
transport.listen();
CommunityTarget comtarget = new CommunityTarget();
comtarget.setCommunity(community1);
comtarget.setVersion(SnmpConstants.version1);
comtarget.setAddress(tHost);
comtarget.setRetries(2);
comtarget.setTimeout(5000);
PDU pdu = new PDU();
pdu.add(new VariableBinding(new OID(strOID)));
pdu.setType(PDU.GET);
snmp = new Snmp(transport);
response = snmp.get(pdu, comtarget);