<?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[Instance Discovery (Port Admin State, Port OperState)]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I tried to get a List of my Ports. The DCI should give me the operState. But just for Port with Admin = up.</p>
<p dir="auto">This is what i tried:</p>
<p dir="auto">dci Name: Port {instance-name}<br />
SNMP OID: .1.3.6.1.2.1.2.2.1.8.{instance}</p>
<p dir="auto">Base OID: .1.3.6.1.2.1.2.2.1.8</p>
<pre><code>snmp = CreateSNMPTransport($node);

value = SNMPGetValue(snmp, ".1.3.6.1.2.1.2.2.1.8." . $1);
nam = SNMPGetValue(snmp, ".1.3.6.1.2.1.31.1.1.1.18." . $1);
adm = SNMPGet(snmp, ".1.3.6.1.2.1.2.2.1.7." . $1);

if (value != null &amp;&amp; value != 0 &amp;&amp; nam != null &amp;&amp; adm-&gt;value == 1)
                return %(true, value, nam);
else return false;
</code></pre>
]]></description><link>https://forum.netxms.org/topic/4651/instance-discovery-port-admin-state-port-operstate</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 16:55:56 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/4651.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 16 Aug 2016 12:47:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Instance Discovery (Port Admin State, Port OperState) on Wed, 17 Aug 2016 09:55:49 GMT]]></title><description><![CDATA[<p dir="auto">That solved the problem. Thank you.</p>
]]></description><link>https://forum.netxms.org/post/20698</link><guid isPermaLink="true">https://forum.netxms.org/post/20698</guid><dc:creator><![CDATA[mike]]></dc:creator><pubDate>Wed, 17 Aug 2016 09:55:49 GMT</pubDate></item><item><title><![CDATA[Reply to Instance Discovery (Port Admin State, Port OperState) on Wed, 17 Aug 2016 09:21:05 GMT]]></title><description><![CDATA[<p dir="auto">Simply do a regex compariston</p>
<pre><code>if (someVar ~= "Test_.*") {
  println("Its a test interface!");
}
</code></pre>
]]></description><link>https://forum.netxms.org/post/20697</link><guid isPermaLink="true">https://forum.netxms.org/post/20697</guid><dc:creator><![CDATA[tomaskir]]></dc:creator><pubDate>Wed, 17 Aug 2016 09:21:05 GMT</pubDate></item><item><title><![CDATA[Reply to Instance Discovery (Port Admin State, Port OperState) on Wed, 17 Aug 2016 06:17:13 GMT]]></title><description><![CDATA[<p dir="auto">Thank you, the "$1" solved the Problem. I attached my configuration in case someone is interested.</p>
<p dir="auto">Is there a chance to check for just the first (or any) part of the description name? I have many ports named "Test_xxx". It would be nice to search for "Test" in the first 4 letters and exclude them too.</p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000003142-1.PNG" alt="1.PNG" class="img-markdown  img-fluid" width="1010" height="730" /></p>
<p dir="auto"><img src="/assets/uploads/files/smf/0000000003144-2.PNG" alt="2.PNG" class="img-markdown  img-fluid" width="1010" height="732" /></p>
]]></description><link>https://forum.netxms.org/post/20691</link><guid isPermaLink="true">https://forum.netxms.org/post/20691</guid><dc:creator><![CDATA[mike]]></dc:creator><pubDate>Wed, 17 Aug 2016 06:17:13 GMT</pubDate></item><item><title><![CDATA[Reply to Instance Discovery (Port Admin State, Port OperState) on Tue, 16 Aug 2016 13:26:55 GMT]]></title><description><![CDATA[<p dir="auto">One (or two) issues here. First of all, ensure that you are using "SNMP walk - OIDs" as discovery method (because you want instance to be interface index). Alternatively, you can change base OID to return interfaces indexes as values.<br />
And most important, you replace original instance value with interface operational state:</p>
<pre><code> return %(true, oper, dec . " - " . nam);
</code></pre>
<p dir="auto">effectively reducing all instances into few. Correct will be to keep interface index as instance:\</p>
<pre><code> return %(true, $1, dec . " - " . nam);
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/20674</link><guid isPermaLink="true">https://forum.netxms.org/post/20674</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 16 Aug 2016 13:26:55 GMT</pubDate></item><item><title><![CDATA[Reply to Instance Discovery (Port Admin State, Port OperState) on Tue, 16 Aug 2016 13:09:40 GMT]]></title><description><![CDATA[<p dir="auto">hi, thanks for reply.<br />
Unfortunately this was a mistake while writing the post.</p>
<p dir="auto">This is my last version:</p>
<pre><code>snmp = CreateSNMPTransport($node);

oper = SNMPGetValue(snmp, ".1.3.6.1.2.1.2.2.1.8." . $1);
nam = SNMPGetValue(snmp, ".1.3.6.1.2.1.31.1.1.1.18." . $1);
adm = SNMPGetValue(snmp, ".1.3.6.1.2.1.2.2.1.7." . $1);
dec = SNMPGetValue(snmp, ".1.3.6.1.2.1.31.1.1.1.1." . $1);

if (oper != null &amp;&amp; oper != 0 &amp;&amp; nam != null &amp;&amp; adm == 1)
      return %(true, oper, dec . " - " . nam);
else return false;
</code></pre>
<p dir="auto">/edit:<br />
I saw that i corrected my mistake 3 seconds before your post. I was a bit too late <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://forum.netxms.org/post/20670</link><guid isPermaLink="true">https://forum.netxms.org/post/20670</guid><dc:creator><![CDATA[mike]]></dc:creator><pubDate>Tue, 16 Aug 2016 13:09:40 GMT</pubDate></item><item><title><![CDATA[Reply to Instance Discovery (Port Admin State, Port OperState) on Tue, 16 Aug 2016 13:01:16 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">you are using undefined variable "transport" here:</p>
<pre><code>adm = SNMPGet(transport, ".1.3.6.1.2.1.2.2.1.7." . $1);
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/20667</link><guid isPermaLink="true">https://forum.netxms.org/post/20667</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 16 Aug 2016 13:01:16 GMT</pubDate></item></channel></rss>