All work
2 of 2
Config-tester not validating varbind matching in event files
Fixed
Description
Environment
tested on 21.0.1, 19.1.0
https://mynms.opennms.com/Ticket/Display.html?id=5420
Acceptance / Success Criteria
None
Attachments
2
Lucidchart Diagrams
Details
Assignee
Patrick SchweizerPatrick SchweizerReporter
John BlakeJohn BlakeFix versions
Priority
Major
Details
Details
Assignee
Patrick Schweizer
Patrick SchweizerReporter
John Blake
John BlakeFix versions
Priority
PagerDuty
PagerDuty
PagerDuty
Created January 15, 2018 at 6:16 PM
Updated July 4, 2018 at 7:26 AM
Resolved July 4, 2018 at 7:26 AM
Activity
Markus von RüdenJuly 4, 2018 at 7:26 AM
To make it easier, to find the PR out of the comments, here it is: https://github.com/OpenNMS/opennms/pull/2029
Patrick SchweizerJune 26, 2018 at 8:46 PM
perfect, thanks!
I added to the unit test so that we cover all 3 cases.
John BlakeJune 26, 2018 at 2:22 PM
you are correct sir.
Patrick SchweizerJune 26, 2018 at 1:08 PM
,
thank you. So just to confirm, the rule is:
if vbvalue is present we require a vbnumber
if no vbvalue is present vbnumber is optional
Is that correct?
That would mean the following snippets are correct:
But this examples is NOT correct:
could you confirm? Thanks!
John BlakeJune 26, 2018 at 12:58 PM
According to Tarus, varbinds in a trap are optional. So varbinds with a snmp trap are not required.
But, if someone has vbvalues configured, then there must be a varbind number to look and see if the value matches.
In an event file, there is the option to match on data in varbinds.
Since the matching needs to have the varbind number AND the value to be matched, those 2 elements should be required. If they are required, the "config-tester" should test for those if one or the other is in the event configuration file.
It currently does not.
for example, this is attempting to match on 2 different varbinds and is correct syntax:
:
<varbind>
<vbnumber>8</vbnumber>
<vbvalue>~.ISDMCDWSS.</vbvalue>
<vbvalue>ISDMCDWSS%</vbvalue>
</varbind>
<varbind>
<vbnumber>4</vbnumber>
<vbvalue>1</vbvalue>
</varbind>
The below is incorrect but the config-test script does not error out.
<varbind>
<vbvalue>~.ISDMCDWSS.</vbvalue>
<vbvalue>ISDMCDWSS%</vbvalue>
</varbind>
<varbind>
<vbnumber>4</vbnumber>
<vbvalue>1</vbvalue>
</varbind>