SNMPManager.java is not working properly

Exception in thread “main” java.lang.NullPointerException: Cannot invoke “org.snmp4j.PDU.get(int)” because the return value of “org.snmp4j.event.ResponseEvent.getResponse()” is null
at SNMPManager.getAsString(SNMPManager.java:43)
at SNMPManager.main(SNMPManager.java:29)

29
String sysDescr = client.getAsString(new OID(".1.3.6.1.2.1.25.2.3.1.5.1")); //Nic Name

43
return event.getResponse().get(0).getVariable().toString();

Windows and linux machines can communicate themselves, and the linux and ip address of the client computer are also set. However, it gives an error.

How Can I resolve this problem.

How Can I resolve this problem

Maybe ask the author of

That class is not part of any SNMP4J API.
Source of the underlying problem might be:

  1. wrong port or address
  2. wrong credentials
  3. too small timeout setting
1 Like

Can you help me on this issue. I need to get OID value on linux machine using SNMPJ4 api with java.

for example

1.3.6.1.2.1.1.2 - sysObjectID

I need to get this value on linux machine with java using SNMPJ4 api