[SNMP4J] odd problem, when using NetBeans IDE

Mike Dorin bsd_mike at hotmail.com
Fri Feb 8 18:10:57 CET 2013





Hello,I am having an odd problem when I use the NetBeans IDE...but have no problem at all using the Eclipse IDE. My program looks kind of like below.  (imports omitted)  I use the simplesnmpclient class found here:http://www.jayway.com/2010/05/21/introduction-to-snmp4j/ On net-beans, the request goes to the agent, and the angent replies..but client.getAsString does not return a string. Thank you, Mike
public class SNMPTester2 {    /**
     * @param args the command line arguments
     */
    public void snmp() throws IOException {
        SimpleSnmpClient client = new SimpleSnmpClient("udp:192.168.1.20/161");
        String sysDescr = client.getAsString(new OID(".1.3.6.1.2.1.1.1.0"));
        System.out.println(sysDescr);
    }    public static void main(String[] args) {
        // TODO code application logic here
        SNMPTester2 ssc = new SNMPTester2();
        try {
            ssc.snmp();
        } catch (IOException ex) {
            Logger.getLogger(SNMPTester2.class.getName()).log(Level.SEVERE, null, ex);
        }
       
    }
} 		 	   		  


More information about the SNMP4J mailing list