<?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[Script based DCIs broken after update]]></title><description><![CDATA[<p dir="auto">I recently upgraded our NetXMS server (and agent) listed below:<br />
netxms-agent:amd64 (6.0.1-1+bookworm, 6.2.3-1+bookworm)<br />
netxms-server:amd64 (6.0.1-1+bookworm, 6.2.3-1+bookworm)<br />
and later (due to this issue)<br />
netxms-agent:amd64 (6.2.3-1+bookworm, 6.2.4-1+bookworm)<br />
netxms-server:amd64 (6.2.3-1+bookworm, 6.2.4-1+bookworm).</p>
<p dir="auto">I had two similar DCIs like this: origin: script, metric: Ping("1.1.1.1",1)</p>
<p dir="auto">And the following script behind:</p>
<pre><code>if ($2) {
	cmd = "ping-suli";
} else {
	cmd = "ping-voda";
}
println("Using: " .. cmd);
res = $node.executeAgentCommandWithOutput(cmd, $1);
if (res.length == 0) return null;
return res;
</code></pre>
<p dir="auto">Both DCIs error with the following: Script (Ping) execution error: Error 14 in line 8: Function or operation argument is not an object</p>
<p dir="auto">But if I use the execute script function with params: "1.1.1.1",1 to run the ping on the same node I get the expected result:</p>
<pre><code>Using: ping-suli


*** FINISHED ***

Result: 25.2
</code></pre>
<p dir="auto">This issue started after the first upgrade and persisted after the second.</p>
]]></description><link>https://forum.netxms.org/topic/8443/script-based-dcis-broken-after-update</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 06:23:08 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/8443.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Sep 2026 09:51:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Script based DCIs broken after update on Mon, 14 Sep 2026 13:12:13 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the info, after reading the docs about <a href="https://netxms.org/documentation/adminguide/agent-management.html#agent-external-parameter" rel="nofollow ugc">Agent External Metrics</a> I converted the actions to shell form metrics and now it works fine.</p>
<p dir="auto">(Before I read the docs I tried the format you provided, but that had some issues which didn't trigger an alarm so I have no idea what was wrong with that.)</p>
]]></description><link>https://forum.netxms.org/post/35774</link><guid isPermaLink="true">https://forum.netxms.org/post/35774</guid><dc:creator><![CDATA[noel]]></dc:creator><pubDate>Mon, 14 Sep 2026 13:12:13 GMT</pubDate></item><item><title><![CDATA[Reply to Script based DCIs broken after update on Fri, 04 Sep 2026 13:09:46 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Not your script - 6.2 added a server configuration parameter <strong>Scripts.RestrictWriteAccess</strong>, enabled by default on new installations and on in-place upgrades. With it on, script-origin DCIs run under a read-only security context, and executeAgentCommandWithOutput() is one of the denied operations: <a href="https://netxms.org/documentation/adminguide/scripting.html#script-write-access-restrictions" rel="nofollow ugc">https://netxms.org/documentation/adminguide/scripting.html#script-write-access-restrictions</a></p>
<p dir="auto">Here's what's actually happening: the denied call does not raise an error. It returns null, the script keeps running, and it dies one line later where res.length hits that null - which is why the error points at line 8 and says "argument is not an object" instead of naming the restriction. In the Script Executor the same script runs under your user's rights, which include the control permission, so it works there and only there.</p>
<p dir="auto">To confirm, enable debug tag <strong>nxsl.security</strong> at level 7 - the denial logs "Read-only script access denied" with the object name and id. Nothing appears at default levels.</p>
<p dir="auto">Two ways out:</p>
<ul>
<li><strong>Turn the restriction off:</strong> Server Configuration -&gt; <strong>Scripts.RestrictWriteAccess</strong> -&gt; 0. Takes effect immediately, no restart. It's a global switch though - it re-enables writes for every restricted script type, not just your DCI.</li>
<li><strong>Move the ping to the agent.</strong> Better fit here, since you're collecting a value rather than modifying anything. In nxagentd.conf, pointing at the same commands your ping-suli / ping-voda actions run:</li>
</ul>
<pre><code>ExternalMetric = PingSuli(*):["/path/to/ping-suli", "$1"]
ExternalMetric = PingVoda(*):["/path/to/ping-voda", "$1"]
</code></pre>
<p dir="auto">Then two Agent-origin DCIs with metrics PingSuli(1.1.1.1) and PingVoda(1.1.1.1). No NXSL, so the restriction doesn't apply - and the if ($2) switch disappears, since you had two DCIs anyway.</p>
<p dir="auto">I've opened <a href="https://github.com/netxms/netxms/issues/3619" rel="nofollow ugc">https://github.com/netxms/netxms/issues/3619</a> on whether script-origin DCIs should be restricted at all - they're a data source, not an analysis script - and <a href="https://github.com/netxms/netxms/issues/3620" rel="nofollow ugc">https://github.com/netxms/netxms/issues/3620</a> on the denial being invisible and surfacing as an unrelated error.</p>
]]></description><link>https://forum.netxms.org/post/35755</link><guid isPermaLink="true">https://forum.netxms.org/post/35755</guid><dc:creator><![CDATA[alk]]></dc:creator><pubDate>Fri, 04 Sep 2026 13:09:46 GMT</pubDate></item></channel></rss>