Java Programming using Adventnet SNMP Java API
Hi everyone, I am trying to write a code that can be able to connect remote SMTP device and a proper responses from that device. However , I have not idea about which classes for this to work (when using Adventnet SMTP java API). Would you all help me about the same..
- Message processing model
- User Security Model
- How to use OID
I am discussing about such concepts as I used these components in SNMP4J..But , I have not any idea to use them in ADVENTNET SNMP API.
Re: Java Programming using Adventnet SNMP Java API
I am working with the snmp4j classes are able to create, send and getting SNMPv1/v2c/v3 messages. A SNMP message is written of its message header and its PDU payloads. This one package have three different and primary groups of classes and interfaces as a linking destination for the SMTP4J libraries. I require to search out something same to Adventnet SNMP as well. I selected to go with the javadocs..It does not tell me how the object and class usage occur when we make the SMTP connection in the network.
Re: Java Programming using Adventnet SNMP Java API
Hello, Whenever I start the snmp-routine, then I got the warning-message as "Unable to load the AdventNet SNMP API properties file" is getting displayed on the screen . How can I search out the properties file or the way through which I can be able to remove out the message activation. How do I get rid from this one error message. :crybaby:
Re: Java Programming using Adventnet SNMP Java API
The gcjsnmp2.jar file always requires the extraction with the manual procedure because the GCJ compiler does not detect into the jar files for the specified classes. It can be performed with the help of JDK's jar utility using the following specified method .
1- Unzip the jar file within the classes directory where the com.adventnet.snmp.snmp2 package contains . The unzipping will result in overwriting of the already having SASClient class in the com/adventnet/snmp/snmp2/directory with the another one SASClient class in the jar.
2- unzip the classes in a different folder. After unzipping, the gcjsnmp2 package should be initially configured within the CLASSPATH suggested by the main AdventNet classes.
Re: Java Programming using Adventnet SNMP Java API
I am running with the exact issue when I use to run the code below :
Code:
import com.adventnet.snmp.beans.*;
public class snmpget {
public snmpget() {
SnmpTarget target = new SnmpTarget();
target.setTargetHost( "localhost");
target.setCommunity("public");
target.setTimeout(5);
target.setRetries(3);
System.out.println(target.getCommunity());
String oids[] = new String[1];
// for (int lp=1;lp<opt.remArgs.length;lp++)
oids[0] = ".1.3.6.1.2.1.1.1.0";
target.setObjectIDList(oids);
String result[] = target.snmpGetList();
if (last == null) {
System.err.println("Request failed or timed out. \n"+
target.getErrorString());
} else {
System.out.println("Response received. Values:");
for (int lp=0;lp<oids.length;lp++) {
System.out.println(target.getObjectID(lp) + ": " + last);
}
}
}
}
It occurs the message as "unable to load the adventNet SNMP API properties file...please suggest me what should I do in this situation ???
Re: Java Programming using Adventnet SNMP Java API
The warning message displays if the snmp.properties file is not stored and configured within the AdventNetSnmp.jar . You are able to verify the similar by stating out the files available wihtin the AdventNetSnmp.jar and check whether the snmp.properties file is saved within the location com/adventnet/snmp/snmp2 . Hope this is clear and can be helpful to solve it out .