[SNMP4J] snmp.inform question
Frank Fock
fock at agentpp.com
Fri Nov 30 00:00:15 CET 2012
Hi Wane,
The most importasnt thing you need to get a response
is a command receiver that returns it.
If you use the SnmpRequest class, then anything else
should be already setup.
Also important is the specify the correct community
or SNMPv3 user credentials.
The IOException is seldom thrown with UDP. For example
if you have no rights on the OS level to open a port.
Best regards,
Frank
Am 29.11.2012 02:06, schrieb Wayne T:
>
> The javadoc states the following for SNMP.inform(...)
> Returns:the received response encapsulated in a ResponseEvent
> instance. To obtain the received response PDU call
> ResponseEvent.getResponse(). If the request timed out,
> that method will return null.
> Throws:
> java.io.IOException - if the inform request could not be send to the specified target.
> The
> snmp.inform command always seems to return a resposeEvent with
> responseEvent.getResponse() == null. It doesn't matter if I send to a
> IP Address that does not exist in the network, or on a port that is not
> listened on. It also does not throw IOException.
>
> In fact, when
> I send an inform PDU using SnmpRequest with args "-v 2c -p INFORM", the
> following code is called but the response is always set to null.
> long startTime = System.nanoTime();
> responseEvent = snmp.send(request, target);
> if (responseEvent != null) {
> response = responseEvent.getResponse();
> System.out.println("Received response after "+
> (System.nanoTime()-startTime)/1000000+" milliseconds");
> }
>
>
> In what case does inform throw an IOException?
>
> Is there something that needs to be initialized so that responseEvent.getResponse() will return something other than null?
>
> Thanks,
>
> Wayne.
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
--
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax: +49 7024 8688231
More information about the SNMP4J
mailing list