xml filter tag content error

JohnD Blackburn <[email protected]> Mon, 6 Aug 2018 06:25:08 +0000
Newsgroups gmane.network.opennms.general
Message-ID <DB6PR0602MB290218D4B7F8A3F85BF30704CB200@DB6PR0602MB2902.eurprd06.prod.outlook.com>
I've just come across an issue with interpretation of the contents of the filter tag.

I was having an issue with a threshold not triggering, that was caused by this filter line:

      <filter>IPADDR != '0.0.0.0' &amp; (nodeSysOID LIKE '.1.3.6.1.4.1.2021.%' | nodeSysOID LIKE '.1.3.6.1.4.1.8072.%' | nodeSysOID LIKE '.1.3.6.1.4.1.311.%)</filter>

Notice the missing quote mark after the last OID

When I investigated the failing threshold, I found a log entry stating that the filter did not match any IP address.

This was broken for more than a month before we noticed it was an issue, and changing the filter line to the following fixed the issue immediately:

      <filter>IPADDR != '0.0.0.0' &amp; (nodeSysOID LIKE '.1.3.6.1.4.1.2021.%' | nodeSysOID LIKE '.1.3.6.1.4.1.8072.%' | nodeSysOID LIKE '.1.3.6.1.4.1.311.%')</filter>

Now I understand that the text between the <filter> and </filter> tags, according to the XML spec, can be just about anything, and therefore, the 1st (incorrect line) is still perfectly valid XML (so the use of xmllint did not show an error)

Would it be possible to make OpenNMS more critical of the content between the "filter" tags so that an error like this could be reported as such?

Regards,
John

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-discuss mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-discuss