All work

Select view

Select search mode

 
50 of 145

Need to check error status code of SNMP PDU when handling SNMP SET response

Description

Hi,

My opennms version is 1.5.93. However, I found this minor bug might exist on all releases of opennms, even chunk.

Problem Description:
When performs a SNMP SET operation on a device, the SET response PDU contain errors (errorStatus is not 0), and return value is correct (return value = set value). In this case, system (OpenNMS) treats it as a successful SET operation. Actually, it fails.

Additional Info:
It is reproducible, and only happened when devices under management had something wrong in their SNMP implementation. And unfortunately, I met that case.

Resolution:
Update processResponse() method of opennms-snmp/opennms-snmp-snmp4j/src/main/java/org/opennms/netmgt/snmp/snmp4j/Snmp4JStrategy.java to check error status code. Here is the diff result of my change proposal:

334d333
< int errorStatusCode = responseEvent.getResponse().getErrorStatus();
346,350c345
< }
< else if (errorStatusCode!=0) {
< log().warn("TTT send: PDU error status code is not 0: " + a);
< }
< else {

> } else {

Regards,
Yu Hong

Environment

Operating System: All Platform: PC

Acceptance / Success Criteria

None

Lucidchart Diagrams

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

PagerDuty

Created March 2, 2009 at 6:27 PM
Updated September 21, 2021 at 6:23 PM

Activity