<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Question about discovery w/ filter]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am new to writing scripts for discovery and have that down ok... but I am looking for a way to also filter the interfaces if they are not active.</p>
<p dir="auto">In this case, I have a sonicwall I wish to monitor, but I don't need to see all the ports not in use.  They all show UP because they use PortShields which connect all the ports in an UP fashion, so I wanted to filter on MTU which in SNMP shows zero on all the ports I wish to ignore.</p>
<p dir="auto">My SNMP DCI looks like this:</p>
<p dir="auto"><strong>Param:</strong> .1.3.6.1.2.1.31.1.1.1.10.{instance}<br />
<strong>Discovery (OID):</strong> .1.3.6.1.2.1.2.2.1.1</p>
<p dir="auto"><strong>Discovery Filter:</strong></p>
<pre><code>transport = CreateSNMPTransport($node);
if (transport == null)
	return false;

// get the interface name to return as instance-name
vb = SNMPGet(transport, ".1.3.6.1.2.1.31.1.1.1.1." . $1);
if (vb == null)
	return false;

// filter out loopback
if (vb-&gt;value == "lo")
	return false;

return %(true, $1, vb-&gt;value);
</code></pre>
<p dir="auto">I know MTU is pulled in and stored with the interfaces, but not sure how to filter in the discovery script I have so far.</p>
<p dir="auto">Like I said, pretty new at this and just getting my hands dirty.... so any help would be greatly appreciated!</p>
]]></description><link>https://forum.netxms.org/topic/5887/question-about-discovery-w-filter</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 10:31:55 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/5887.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 Apr 2019 00:40:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Question about discovery w/ filter on Wed, 22 May 2019 02:04:46 GMT]]></title><description><![CDATA[<p dir="auto">Sorry for my delay... I thought I responded.  Thank you! Worked perfectly!</p>
]]></description><link>https://forum.netxms.org/post/25742</link><guid isPermaLink="true">https://forum.netxms.org/post/25742</guid><dc:creator><![CDATA[sjudy]]></dc:creator><pubDate>Wed, 22 May 2019 02:04:46 GMT</pubDate></item><item><title><![CDATA[Reply to Question about discovery w/ filter on Wed, 03 Apr 2019 10:55:46 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">knowing interface index you can use function GetInterfaceObject($node, index) to get interface object, and then read it's property "mtu". Alternative approach could be to send SNMP request for .1.3.6.1.2.1.2.2.1.4.{instance} as you do for interface name.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/25528</link><guid isPermaLink="true">https://forum.netxms.org/post/25528</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Wed, 03 Apr 2019 10:55:46 GMT</pubDate></item></channel></rss>