<?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[Can a script DCI return multiple variables/DCIs?]]></title><description><![CDATA[<p dir="auto">Dear community</p>
<p dir="auto">I'm looking for a way to create a Dashboard with all BGP sessions that are down from multiple devices. The way I'm doing it is creating independent DCIs under the NetXMS server that return tables and other variables and then include the data in a Dashboard. Is it possible to return multiple variables using the same script? For example, return a table, an integer DCI, a string, etc. The idea would be to use a single script instead of multiple ones.</p>
<p dir="auto">Probably there is better way to achieve same report</p>
<p dir="auto">Your input would be appreciate it</p>
<p dir="auto">Thank you</p>
]]></description><link>https://forum.netxms.org/topic/7084/can-a-script-dci-return-multiple-variables-dcis</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 16:17:19 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7084.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 14 Jun 2021 21:28:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can a script DCI return multiple variables/DCIs? on Tue, 15 Jun 2021 15:55:49 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Alex/Filipp</p>
<p dir="auto">I will try proposed options.</p>
]]></description><link>https://forum.netxms.org/post/30157</link><guid isPermaLink="true">https://forum.netxms.org/post/30157</guid><dc:creator><![CDATA[mmarin11]]></dc:creator><pubDate>Tue, 15 Jun 2021 15:55:49 GMT</pubDate></item><item><title><![CDATA[Reply to Can a script DCI return multiple variables/DCIs? on Tue, 15 Jun 2021 07:47:13 GMT]]></title><description><![CDATA[<p dir="auto">Another option could be to create push DCIs use PushDCIData(). You can e.g. do this from a transormation script of of another DCI.</p>
]]></description><link>https://forum.netxms.org/post/30149</link><guid isPermaLink="true">https://forum.netxms.org/post/30149</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Tue, 15 Jun 2021 07:47:13 GMT</pubDate></item><item><title><![CDATA[Reply to Can a script DCI return multiple variables/DCIs? on Tue, 15 Jun 2021 06:01:52 GMT]]></title><description><![CDATA[<p dir="auto">There are multiple ways to achieve that.<br />
If it's ok for you to query data multiple times - just extract common code into a script in the library, then use it in the transformation / wrapper scripts:</p>
<pre><code>// Library script "lib1"
function collect() {
  // collect data and return as array of records
}

// transformation script on the DCI or source script:
records = lib1::collect();
return records[0]; // add logic here

// for tables:
records = lib1::collect();
t = Table(); // or use $1 if it's transformation script
t-&gt;addColumn("col1"); // required only when creating table from scratch
t-&gt;addColumn("col2");
for (r : records) { // add logic here
   row = t-&gt;addRow();
   t-&gt;set(row, 0, r[0]);
   t-&gt;set(row, 1, r[1]);
}
</code></pre>
<p dir="auto">Another option is to create table DCI, then use this DCI as data source for any other, e.g.:</p>
<pre><code>// GetDCIValue() and GetDCIValueByDescription() might be usefull (see https://www.netxms.org/documentation/nxsl-latest/#_data_collection)
t = GetDCIValueByName($node, "My.Table.DCI"); // result will be either String or Table object
return t-&gt;findRowByInstance("peer1")-&gt;get("col1"); // you can use  either column names or indexes in get()
</code></pre>
]]></description><link>https://forum.netxms.org/post/30148</link><guid isPermaLink="true">https://forum.netxms.org/post/30148</guid><dc:creator><![CDATA[alk]]></dc:creator><pubDate>Tue, 15 Jun 2021 06:01:52 GMT</pubDate></item></channel></rss>