[SNMP4J] Snmp INFORM response problem
Tayyab Akram
mail.tayyab at gmail.com
Wed Sep 17 13:06:59 CEST 2008
Hi all,
I need some help,
I have implemented trap receiver using Snmp4j and now I am sending SnmpV3
INFORM using net-snmp tool "*snmpinform*"
I have implemented the *processPdu()* function to response the INFORM
messages as told by Jeff.
Still *snmpinform* fails due to bad response, Below is the output of the
snmpinform command,
[root at localhost]# *snmpinform -v 3 -u wes localhost ''
SNMPv2-MIB::sysLocation.0*
*snmpinform: Timeout (plaintext scopedPDU header type A6: s/b 30)*
Can anybody tell me what's wrong???
I used WireShark paket sniffer to see the packets which shows,
*snmpinform* sent 5 INFORMS (retries).... Against every INFORM my Trap
Receiver sent response but Packet Sniffer shows that the response packets
have *WRONG UDP CHECKSUM*.
Can anybody give some hint about what could be wrong???
Why my code is sending Bad response?? Below is the implementation of my *
processPdu()* function,
public void processPdu(CommandResponderEvent crEvent) {
crEvent.setProcessed(true);
PDU trapPDU = new PDU(crEvent.getPDU());
if(trapPDU != null) {
if(trapPDU.getType() == PDU.INFORM) {
*PDU responsePDU = new PDU(trapPDU);*
responsePDU.setErrorIndex(0);
responsePDU.setErrorStatus(0);
responsePDU.setType(PDU.RESPONSE);
StatusInformation statusInfo = new StatusInformation();
StateReference stateRef = crEvent.getStateReference();
try {
*crEvent.getMessageDispatcher().returnResponsePdu(
crEvent.getMessageProcessingModel(),
crEvent.getSecurityModel(),
crEvent.getSecurityName(),
crEvent.getSecurityLevel(),
trapPDU,
crEvent.getMaxSizeResponsePDU(),
stateRef,
statusInfo);*
} catch (MessageException msgEx) {
Logger.error(msgEx);
}
}
}
Thanks in advance,
--Tayyab
More information about the SNMP4J
mailing list