<?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[Вопрос по DCI]]></title><description><![CDATA[<p dir="auto">Скажите</p>
<p dir="auto">если я знаю DCI name - например "Serial Number"<br />
и его значение - 205003573</p>
<p dir="auto">То как я могу определить к какой ноде он принадлежит? может скрипт какой ?</p>
<p dir="auto">Заранее спасибо.</p>
]]></description><link>https://forum.netxms.org/topic/1908/вопрос-по-dci</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 18:37:55 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/1908.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Sep 2012 12:02:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Вопрос по DCI on Thu, 06 Sep 2012 10:11:55 GMT]]></title><description><![CDATA[<p dir="auto">Все получилось. Спасибо.</p>
]]></description><link>https://forum.netxms.org/post/8395</link><guid isPermaLink="true">https://forum.netxms.org/post/8395</guid><dc:creator><![CDATA[inspirit]]></dc:creator><pubDate>Thu, 06 Sep 2012 10:11:55 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 18:15:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/inspirit" aria-label="Profile: inspirit">@<bdi>inspirit</bdi></a> said in <a href="/post/8390">Вопрос по DCI</a>:</p>
<blockquote>
<p dir="auto">У меня при выполнении данного скрипта пишет</p>
<p dir="auto">ERROR: Script finished with error: Error 14 in line 10: Function or operation argument is not an object.</p>
<p dir="auto">Что за.. ошибся где ?</p>
</blockquote>
<p dir="auto">Скорее всего параметр сервера CheckTrustedNodes выставлен в 1. Поставьте в 0 (сервер надо быдет рестартануть после этого), должно заработать. Подробнее про CheckTrustedNodes здесь: <a href="http://wiki.netxms.org/wiki/SG:Security_Issues" rel="nofollow ugc">http://wiki.netxms.org/wiki/SG:Security_Issues</a>.</p>
]]></description><link>https://forum.netxms.org/post/8392</link><guid isPermaLink="true">https://forum.netxms.org/post/8392</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Wed, 05 Sep 2012 18:15:18 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 18:00:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/inspirit" aria-label="Profile: inspirit">@<bdi>inspirit</bdi></a> said in <a href="/post/8390">Вопрос по DCI</a>:</p>
<blockquote>
<p dir="auto">У меня при выполнении данного скрипта пишет</p>
<p dir="auto">ERROR: Script finished with error: Error 14 in line 10: Function or operation argument is not an object.</p>
<p dir="auto">Что за.. ошибся где ?</p>
</blockquote>
<p dir="auto">Это значит что где-то с аргументами ошибся<br />
для отлаки можешь return'ов понаткать в коде или println</p>
]]></description><link>https://forum.netxms.org/post/8391</link><guid isPermaLink="true">https://forum.netxms.org/post/8391</guid><dc:creator><![CDATA[SKYnv]]></dc:creator><pubDate>Wed, 05 Sep 2012 18:00:59 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 17:37:59 GMT]]></title><description><![CDATA[<p dir="auto">У меня при выполнении данного скрипта пишет</p>
<p dir="auto">ERROR: Script finished with error: Error 14 in line 10: Function or operation argument is not an object.</p>
<p dir="auto">Что за.. ошибся где ?</p>
]]></description><link>https://forum.netxms.org/post/8390</link><guid isPermaLink="true">https://forum.netxms.org/post/8390</guid><dc:creator><![CDATA[inspirit]]></dc:creator><pubDate>Wed, 05 Sep 2012 17:37:59 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 15:26:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/victor" aria-label="Profile: victor">@<bdi>victor</bdi></a> said in <a href="/post/8388">Вопрос по DCI</a>:</p>
<blockquote>
<p dir="auto">Там написано "Previous value of custom attribute or NULL if attribute was not defined before.". Т.е. если атрибут уже был, функция вернет его старое значение, а если его не было, то создаст и вернет NULL. У меня в примерах после стрелочки -&gt; идет результат вызова функции - в данном случае это и будет NULL (предполагая что это чистая система).</p>
</blockquote>
<p dir="auto">хм, тогда извиняйте проглядел. Или когда экспериментировал где-то не сошлось что-то. Спасибо.</p>
<p dir="auto">Тогда мой способ заполнения информации можно тоже смело применять ) Вот ещебы овервиф подкрутить <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--wink" style="height:1.4em;width:auto;vertical-align:middle" title=";)" alt="😉" /></p>
]]></description><link>https://forum.netxms.org/post/8389</link><guid isPermaLink="true">https://forum.netxms.org/post/8389</guid><dc:creator><![CDATA[SKYnv]]></dc:creator><pubDate>Wed, 05 Sep 2012 15:26:03 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 15:23:54 GMT]]></title><description><![CDATA[<p dir="auto">Там написано "Previous value of custom attribute or NULL if attribute was not defined before.". Т.е. если атрибут уже был, функция вернет его старое значение, а если его не было, то создаст и вернет NULL. У меня в примерах после стрелочки -&gt; идет результат вызова функции - в данном случае это и будет NULL (предполагая что это чистая система).</p>
]]></description><link>https://forum.netxms.org/post/8388</link><guid isPermaLink="true">https://forum.netxms.org/post/8388</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Wed, 05 Sep 2012 15:23:54 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 15:20:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/victor" aria-label="Profile: victor">@<bdi>victor</bdi></a> said in <a href="/post/8386">Вопрос по DCI</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/skynv" aria-label="Profile: skynv">@<bdi>skynv</bdi></a> said in <a href="/post/8383">Вопрос по DCI</a>:</p>
<blockquote>
<p dir="auto">Ну и неплохо бы еще функцию добавить CreateCustomAttribute($node,"attr_name")</p>
</blockquote>
<p dir="auto"><a href="http://wiki.netxms.org/wiki/NXSL:SetCustomAttribute" rel="nofollow ugc">http://wiki.netxms.org/wiki/NXSL:SetCustomAttribute</a> <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>
</blockquote>
<p dir="auto">Да, но там написано</p>
<pre><code>SetCustomAttribute($node, "non_existing_attribute", "new value")	-&gt; NULL
</code></pre>
<p dir="auto">а нужно</p>
<pre><code>SetCustomAttribute($node, "non_existing_attribute", "new value")	-&gt; Attribute not found. Create ne attribute with name "non_existing_attribute"
</code></pre>
<p dir="auto">для создания, а не изменения атрибутов ))</p>
]]></description><link>https://forum.netxms.org/post/8387</link><guid isPermaLink="true">https://forum.netxms.org/post/8387</guid><dc:creator><![CDATA[SKYnv]]></dc:creator><pubDate>Wed, 05 Sep 2012 15:20:32 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 15:15:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/skynv" aria-label="Profile: skynv">@<bdi>skynv</bdi></a> said in <a href="/post/8383">Вопрос по DCI</a>:</p>
<blockquote>
<p dir="auto">Ну и неплохо бы еще функцию добавить CreateCustomAttribute($node,"attr_name")</p>
</blockquote>
<p dir="auto"><a href="http://wiki.netxms.org/wiki/NXSL:SetCustomAttribute" rel="nofollow ugc">http://wiki.netxms.org/wiki/NXSL:SetCustomAttribute</a> <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/8386</link><guid isPermaLink="true">https://forum.netxms.org/post/8386</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Wed, 05 Sep 2012 15:15:15 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 15:14:15 GMT]]></title><description><![CDATA[<p dir="auto">Можно написать такой скрипт (в Script Library):</p>
<pre><code>// Find "Entire Network" object and start enumeration from it
println "Searching node with serial number '" . $1 . "'...";
EnumerateNodes(FindObject(1), $1);
println "Node with serial number " . $1 . " not found";

// This function walks object tree recursively starting from given root
sub EnumerateNodes(rootObject, serialNumber)
{
    // Walk all child objects
    foreach(o : GetObjectChildren(rootObject))
    {
        if (classof(o) == "Node")
        {
            // Process node object
				value = GetDCIValueByDescription(o, "Serial number");
            if (value == serialNumber)
            {
            	println "Node found: " . o-&gt;name;
            	exit;
            }
        }
        else if (classof(o) == "NetObj")
        {
            // For all other objects, go down the tree
            // There can be additional checks for object class, like
            // if (o-&gt;type == 5)
            EnumerateNodes(o, serialNumber);
        }
    }
}
</code></pre>
<p dir="auto">и запустить его с консоли сервера (или через nxadm) командой exec:</p>
<pre><code>netxmsd: exec FindBySerial 1200
Searching node with serial number '1200'...
Node found: 10.8.0.9
INFO: Script finished with rc=0

netxmsd: exec FindBySerial 1201
Searching node with serial number '1201'...
Node with serial number 1201 not found
INFO: Script finished with rc=0
</code></pre>
<p dir="auto">(у меня скрипт назван FindBySerial)</p>
<p dir="auto">println в консоли будет работать только в 1.2.3-rc5 и выше, для предыдущих версий надо использовать trace и смотреть результат в логе.</p>
]]></description><link>https://forum.netxms.org/post/8385</link><guid isPermaLink="true">https://forum.netxms.org/post/8385</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Wed, 05 Sep 2012 15:14:15 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 15:04:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/inspirit" aria-label="Profile: inspirit">@<bdi>inspirit</bdi></a> said:</p>
<blockquote>
<p dir="auto">ситуация проста. Знаем что в Netxms есть коммутутаторы которые стоят по городу. Через autoaply template к ним автоматически привязываются DCI при добавлении и в том числе опрос Serial Number. Ну и как водится \проектный отдел\ потерял документы по этому оборудованию и знает только его серийник. Вопрос - как узнать что это за оборудование и где оно стоит ? )) Руками искать среди сотен коммутаторов в поисках нужного серийника - как то некруто. Вот и родилась мысль )</p>
</blockquote>
<p dir="auto">а, у меня похожая ситуация. Но я пойду другим немножко путем.</p>
<ol>
<li>создаем нодам кастом атрибут &gt; Serial</li>
<li>далее скриптом обходим все ноды и записываем в этот кастом атрибут нужное значение. Ну и попутно можно вывести инфу о ноде айпи и т.д. прямо в консоль.<br />
Ну и поиск также можно организовать, перебор нод и сравнением."</li>
</ol>
<p dir="auto">плюс пролобирую еще вывод кастом атрибутов на овервиф таб <a href="https://www.netxms.org/forum/e-eoe-o-koaot-netxms/overview-tab/" rel="nofollow ugc">https://www.netxms.org/forum/e-eoe-o-koaot-netxms/overview-tab/</a><br />
Ну и неплохо бы еще функцию добавить CreateCustomAttribute($node,"attr_name")</p>
]]></description><link>https://forum.netxms.org/post/8383</link><guid isPermaLink="true">https://forum.netxms.org/post/8383</guid><dc:creator><![CDATA[SKYnv]]></dc:creator><pubDate>Wed, 05 Sep 2012 15:04:29 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 14:57:17 GMT]]></title><description><![CDATA[<p dir="auto">ситуация проста. Знаем что в Netxms есть коммутутаторы которые стоят по городу. Через autoaply template к ним автоматически привязываются DCI при добавлении и в том числе опрос Serial Number. Ну и как водится \проектный отдел\ потерял документы по этому оборудованию и знает только его серийник. Вопрос - как узнать что это за оборудование и где оно стоит ? )) Руками искать среди сотен коммутаторов в поисках нужного серийника - как то некруто. Вот и родилась мысль )</p>
]]></description><link>https://forum.netxms.org/post/8382</link><guid isPermaLink="true">https://forum.netxms.org/post/8382</guid><dc:creator><![CDATA[inspirit]]></dc:creator><pubDate>Wed, 05 Sep 2012 14:57:17 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 14:50:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/inspirit" aria-label="Profile: inspirit">@<bdi>inspirit</bdi></a> said in <a href="/post/8376">Вопрос по DCI</a>:</p>
<blockquote>
<p dir="auto">Скажите</p>
<p dir="auto">если я знаю DCI name - например "Serial Number"<br />
и его значение - 205003573</p>
<p dir="auto">То как я могу определить к какой ноде он принадлежит? может скрипт какой ?</p>
<p dir="auto">Заранее спасибо.</p>
</blockquote>
<p dir="auto">А в какой ситуации это нужно?</p>
]]></description><link>https://forum.netxms.org/post/8380</link><guid isPermaLink="true">https://forum.netxms.org/post/8380</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Wed, 05 Sep 2012 14:50:03 GMT</pubDate></item><item><title><![CDATA[Reply to Вопрос по DCI on Wed, 05 Sep 2012 13:06:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/inspirit" aria-label="Profile: inspirit">@<bdi>inspirit</bdi></a> said in <a href="/post/8376">Вопрос по DCI</a>:</p>
<blockquote>
<p dir="auto">Скажите</p>
<p dir="auto">если я знаю DCI name - например "Serial Number"<br />
и его значение - 205003573</p>
<p dir="auto">То как я могу определить к какой ноде он принадлежит? может скрипт какой ?</p>
<p dir="auto">Заранее спасибо.</p>
</blockquote>
<p dir="auto"><a href="http://wiki.netxms.org/wiki/NXSL_Function_Reference#Data_Collection" rel="nofollow ugc">http://wiki.netxms.org/wiki/NXSL_Function_Reference#Data_Collection</a></p>
<p dir="auto">поэкспериментируйте с данными функциями.</p>
]]></description><link>https://forum.netxms.org/post/8378</link><guid isPermaLink="true">https://forum.netxms.org/post/8378</guid><dc:creator><![CDATA[SKYnv]]></dc:creator><pubDate>Wed, 05 Sep 2012 13:06:39 GMT</pubDate></item></channel></rss>