throw new KettleException( "Invalid IP address" ); target.setRetries( retry ); target.setTimeout( timeOut );
private Target getTargetForWrite() { CommunityTarget target = new CommunityTarget(); target.setCommunity(new OctetString("public"));\\<--- target.setVersion(SnmpConstants.version2c); target.setAddress(GenericAddress.parse(address)); target.setRetries(2); target.setTimeout(1500); return target; }
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; }
/** * <p>getTarget.</p> * * @return a {@link org.snmp4j.Target} object. */ protected Target getTarget() { CommunityTarget target = new CommunityTarget(); target.setCommunity(new OctetString(snmpCommunity)); target.setAddress(this.udpAddress); target.setRetries(retries); target.setTimeout(timeout); target.setVersion(SnmpConstants.version1); return target; } /** {@inheritDoc} */
/** * <p>getTarget.</p> * * @return a {@link org.snmp4j.Target} object. */ protected Target getTarget() { CommunityTarget target = new CommunityTarget(); target.setCommunity(new OctetString(snmpCommunity)); target.setAddress(this.tcpAddress); target.setRetries(retries); target.setTimeout(timeout); target.setVersion(SnmpConstants.version1); return target; } /** {@inheritDoc} */
/** * <p>getTarget.</p> * * @return a {@link org.snmp4j.Target} object. */ protected Target getTarget() { CommunityTarget target = new CommunityTarget(); target.setCommunity(new OctetString(snmpCommunity)); target.setAddress(this.tcpAddress); target.setRetries(retries); target.setTimeout(timeout); target.setVersion(SnmpConstants.version2c); return target; } /** {@inheritDoc} */
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; } }
target.setCommunity(provider.getCommunity(itemName)); target.setAddress(provider.getAddress(itemName)); target.setRetries(retries); target.setTimeout(timeout); target.setVersion(provider.getSnmpVersion(itemName));
Address targetAddress = GenericAddress.parse("udp:127.0.0.1/1161"); target.setAddress(targetAddress); target.setRetries(2); target.setTimeout(2000); try {
Address targetAddress = GenericAddress.parse("udp:127.0.0.1/1161"); target.setAddress(targetAddress); target.setRetries(2); target.setTimeout(2000); try {
Address targetAddress = GenericAddress.parse("udp:127.0.0.1/1161"); target.setAddress(targetAddress); target.setRetries(2); target.setTimeout(2000);
/** * <p>getTarget.</p> * * @return a {@link org.snmp4j.Target} object. */ protected Target getTarget() { CommunityTarget target = new CommunityTarget(); target.setCommunity(new OctetString(snmpCommunity)); target.setAddress(this.udpAddress); target.setRetries(retries); target.setMaxSizeRequestPDU(maxSizeRequestPDU); target.setTimeout(timeout); target.setVersion(SnmpConstants.version2c); return target; } /** {@inheritDoc} */
Address targetAddress = GenericAddress.parse("udp:127.0.0.1/1161"); target.setAddress(targetAddress); target.setRetries(2); target.setTimeout(1000); try{
target.setCommunity(providerCmd.getCommunity(itemName, command)); target.setAddress(providerCmd.getAddress(itemName, command)); target.setRetries(retries); target.setTimeout(timeout); target.setVersion(providerCmd.getSnmpVersion(itemName, command));
Address targetAddress = GenericAddress.parse("udp:127.0.0.1/1161"); target.setAddress(targetAddress); target.setRetries(2); target.setTimeout(2000);
public Target createTarget () { switch ( this.connectionInformation.getVersion () ) { case V1: if ( this.connectionInformation.getCommunity () != null ) { final CommunityTarget target = new CommunityTarget ( this.address, new OctetString ( this.connectionInformation.getCommunity () ) ); target.setRetries ( this.connectionInformation.getRetries () ); target.setVersion ( SnmpConstants.version1 ); target.setTimeout ( this.connectionInformation.getTimeout () ); return target; } break; case V2C: if ( this.connectionInformation.getCommunity () != null ) { final CommunityTarget target = new CommunityTarget ( this.address, new OctetString ( this.connectionInformation.getCommunity () ) ); target.setRetries ( this.connectionInformation.getRetries () ); target.setVersion ( SnmpConstants.version2c ); target.setTimeout ( this.connectionInformation.getTimeout () ); return target; } break; case V3: return null; } return null; }
@Override protected void doStart() throws Exception { super.doStart(); this.targetAddress = GenericAddress.parse(this.endpoint.getAddress()); LOG.debug("targetAddress: {}", targetAddress); this.usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0); SecurityModels.getInstance().addSecurityModel(this.usm); // setting up target this.target = new CommunityTarget(); this.target.setCommunity(new OctetString(endpoint.getSnmpCommunity())); this.target.setAddress(this.targetAddress); this.target.setRetries(this.endpoint.getRetries()); this.target.setTimeout(this.endpoint.getTimeout()); this.target.setVersion(this.endpoint.getSnmpVersion()); }
@Override public synchronized void activate() throws Exception { super.activate(); this.targetAddress = GenericAddress.parse(this.address); this.transport = new DefaultUdpTransportMapping(); this.snmp = new Snmp(transport); this.usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0); SecurityModels.getInstance().addSecurityModel(usm); // setting up target target = new CommunityTarget(); target.setCommunity(new OctetString(this.snmpCommunity)); target.setAddress(targetAddress); target.setRetries(this.retries); target.setTimeout(this.timeout); target.setVersion(this.snmpVersion); // creating PDU this.pdu = new PDU(); }
@Override protected void doStart() throws Exception { super.doStart(); this.targetAddress = GenericAddress.parse(this.endpoint.getAddress()); LOG.debug("targetAddress: {}", targetAddress); this.usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0); SecurityModels.getInstance().addSecurityModel(this.usm); // setting up target this.target = new CommunityTarget(); this.target.setCommunity(new OctetString(endpoint.getSnmpCommunity())); this.target.setAddress(this.targetAddress); this.target.setRetries(this.endpoint.getRetries()); this.target.setTimeout(this.endpoint.getTimeout()); this.target.setVersion(this.endpoint.getSnmpVersion()); this.pdu = new PDU(); for (OID oid : this.endpoint.getOids()) { this.pdu.add(new VariableBinding(oid)); } this.pdu.setErrorIndex(0); this.pdu.setErrorStatus(0); this.pdu.setMaxRepetitions(0); this.pdu.setType(PDU.GET); }
communityTarget.setRetries(endpoint.getRetries()); communityTarget.setTimeout(endpoint.getTimeout()); communityTarget.setVersion(endpoint.getSnmpVersion());