Message Error in DnsMonitor

Description

DNS Monitor (org.opennms.netmgt.poller.monitors.DnsMonitor) Returns wrong message for alarm.

Created a DNS Monitor for google.ca which contains 4 A Name records

;; ANSWER SECTION:
google.ca. 3 IN A 173.194.33.183
google.ca. 3 IN A 173.194.33.191
google.ca. 3 IN A 173.194.33.175
google.ca. 3 IN A 173.194.33.184

I set the monitor for

<parameter key="min-answers" value="1" />
<parameter key="max-answers" value="3 />

The outage message returned was:

DNS outage identified on interface xx.xx.xx.xx with reason code: Response contained 4 answer(s), but 1 or fewer answers(s) are needed..

According to the code, it appears to be using the wrong param in the error message

https://raw.githubusercontent.com/OpenNMS/opennms/master/opennms-services/src/main/java/org/opennms/netmgt/poller/monitors/DnsMonitor.java

if (tooManyAnswers) {
status = PollStatus.unavailable("Response contained " + numAnswers + " answer(s), but " + minAnswers + " or fewer answers(s) are needed.");
LOG.warn(status.getReason());
return status;
}

I'm guessing this should have been 'maxAnswers' instead which would have then produced the following error message:

DNS outage identified on interface xx.xx.xx.xx with reason code: Response contained 4 answer(s), but 3 or fewer answers(s) are needed..

Second, Should this really be worded as an "outage"? Just seems weird sounding to me since the server is returning records in this case, too many of them.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Seth Leger January 26, 2015 at 11:47 AM

I fixed this problem for inclusion in 15. Marking as fixed.

commit dd8b211fea4bafbf972c7b311779dc0b406c29bf

Fixed

Details

Assignee

Reporter

Original estimate

Time tracking

No time logged5m remaining

Fix versions

Affects versions

Priority

PagerDuty

Created October 29, 2014 at 3:09 PM
Updated May 11, 2015 at 2:49 PM
Resolved January 26, 2015 at 11:47 AM

Flag notifications