<?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[scripting management functions [SOLVED]]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">   I have been creating filtering and even some scripts that imitate snmpwalk or trying to polish tool to mass-create DCI (based on my snmpwalk) but some problems with management functions arised.<br />
(I am looking into python for nxshell functionality now, but I believe commands from <a href="http://wiki.netxms.org/wiki/NXSL_Function_Reference" rel="nofollow ugc">Function Reference</a> should be working without nxshell.)</p>
<p dir="auto">Some functions work, but some do not and I don't know why..</p>
<p dir="auto">For example - GetNodeParents, GetNodeInterfaces, GetObjectParents, GetObjectChildren</p>
<p dir="auto">The first line where I use these functions makes the script broken, even test scripts like this are not working...</p>
<pre><code>interfaces = GetNodeInterfaces($1);
foreach(i : interfaces)
{
    println "Interface: name='" . i-&gt;name . "' id=" . i-&gt;id;
}
</code></pre>
<p dir="auto">All I get is: <em>ERROR: Script finished with error: Error 14 in line 1: Function or operation argument is not an object</em></p>
<p dir="auto">Can someone enlighten me what I do wrong please?</p>
<p dir="auto">With regards</p>
<p dir="auto">Milan Sperl</p>
]]></description><link>https://forum.netxms.org/topic/2431/scripting-management-functions-solved</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 11:41:56 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/2431.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Jun 2013 07:43:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to scripting management functions [SOLVED] on Tue, 11 Jun 2013 22:20:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sperlm" aria-label="Profile: sperlm">@<bdi>sperlm</bdi></a> said in <a href="/post/10507">scripting management functions [SOLVED]</a>:</p>
<blockquote>
<p dir="auto">The "null" parameter in findObjectNode was not clear to me (but it works with it too).</p>
</blockquote>
<p dir="auto">It's a reference to already known object. Here is the explanation: <a href="http://wiki.netxms.org/wiki/SG:Security_Issues" rel="nofollow ugc">http://wiki.netxms.org/wiki/SG:Security_Issues</a>.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/10512</link><guid isPermaLink="true">https://forum.netxms.org/post/10512</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 11 Jun 2013 22:20:24 GMT</pubDate></item><item><title><![CDATA[Reply to scripting management functions [SOLVED] on Tue, 11 Jun 2013 16:00:36 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for pointing the problem for me.<br />
I should have used the findObject function and I have to use ID of the tested node only. Cannot use Object Name, which is OK for testing purposes, in called scripts I can use $node again.<br />
The "null" parameter in findObjectNode was not clear to me (but it works with it too).</p>
<p dir="auto">Thanks once more.</p>
<p dir="auto">Milan Sperl</p>
]]></description><link>https://forum.netxms.org/post/10507</link><guid isPermaLink="true">https://forum.netxms.org/post/10507</guid><dc:creator><![CDATA[sperlm]]></dc:creator><pubDate>Tue, 11 Jun 2013 16:00:36 GMT</pubDate></item><item><title><![CDATA[Reply to scripting management functions [SOLVED] on Tue, 11 Jun 2013 15:12:30 GMT]]></title><description><![CDATA[<p dir="auto">Node name is a string, not an object reference. If you want to find node object by name, you could use FindObject or FindNodeObject function, like this:</p>
<pre><code>node = FindNodeObject(null, $1);
println "Node ID: " node-&gt;id;
</code></pre>
<p dir="auto">Also check this script example: <a href="http://wiki.netxms.org/wiki/Script_Example:_Read_SNMP_Value_From_Node" rel="nofollow ugc">http://wiki.netxms.org/wiki/Script_Example:_Read_SNMP_Value_From_Node</a></p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/10503</link><guid isPermaLink="true">https://forum.netxms.org/post/10503</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 11 Jun 2013 15:12:30 GMT</pubDate></item><item><title><![CDATA[Reply to scripting management functions [SOLVED] on Tue, 11 Jun 2013 15:12:15 GMT]]></title><description><![CDATA[<p dir="auto">Sorry for not explaining - I am using $1 because I am running the script from Server Console and provide node name as first parameter of course. That is why I am "printing" the results.<br />
I even tried to set node name (or ID) instead of $1 to remove the possibility this parameter is at fault.<br />
If I set node name (e.g. Core1-SW) the error changes to:<br />
_Error 5: Invalid operation with NULL value_</p>
<p dir="auto">Thanks for the reply</p>
<p dir="auto">Milan Sperl</p>
]]></description><link>https://forum.netxms.org/post/10502</link><guid isPermaLink="true">https://forum.netxms.org/post/10502</guid><dc:creator><![CDATA[sperlm]]></dc:creator><pubDate>Tue, 11 Jun 2013 15:12:15 GMT</pubDate></item><item><title><![CDATA[Reply to scripting management functions [SOLVED] on Tue, 11 Jun 2013 14:42:28 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">You pass $1 to GetNodeInterfaces. It's a first argument of the script. It depends on context, but it's unlikely that it will be node object. If you want to work with "current" node (i.e. owner node of DCI in transformation script), you can use built-in variable $node. In other cases, you can use FindNodeObject function to obtain reference to node object you are interested in.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/10498</link><guid isPermaLink="true">https://forum.netxms.org/post/10498</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 11 Jun 2013 14:42:28 GMT</pubDate></item></channel></rss>