<?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[Object query dashboard component]]></title><description><![CDATA[<p dir="auto">Dear community</p>
<p dir="auto">I'm trying to create a dashboard with a list of DCIs that have a specific description. I'm tracking service latency and a node can have multiple DCIs with latency description. If I create the object query as dashboard element I get the following error 'Cannot execute object query: Request timed out' I'm probably doing something wrong with the script. Does someone has an example on how to use dashboards object queries?</p>
<p dir="auto">list=GetAllNodes();</p>
<p dir="auto">foreach (item : list){<br />
    if (classof(item) == "Node")<br />
    {<br />
        for(d : FindAllDCIs(item,null,"*latency*"))<br />
        {</p>
<p dir="auto">            v=GetDCIValue(item, d-&gt;id);<br />
                        if (v == null) {<br />
                continue;<br />
            }<br />
            name = d-&gt;name;<br />
            description = d-&gt;description;</p>
<p dir="auto">            <br />
            <br />
            return (item-&gt;snmpSysName. " " .description ." ".v);<br />
            <br />
        <br />
        }<br />
    <br />
    }</p>
<p dir="auto">}</p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000005492-Properties_for_2021-05-17_20-56-48.png" alt="Properties for  2021-05-17 20-56-48.png" class="img-markdown  img-fluid" width="714" height="588" /></p>
]]></description><link>https://forum.netxms.org/topic/7052/object-query-dashboard-component</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 14:04:43 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7052.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 May 2021 02:57:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Object query dashboard component on Mon, 07 Aug 2023 06:41:22 GMT]]></title><description><![CDATA[<p dir="auto">On a node you need to create "New table", not "New parameter". In properties of that table DCI name of the script from script library is specified. Then you should be able to open "Table last value" - the whole table should be visible there.</p>
<p dir="auto">Then in Dashboard it's Tables-&gt;Table value</p>
]]></description><link>https://forum.netxms.org/post/32643</link><guid isPermaLink="true">https://forum.netxms.org/post/32643</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Mon, 07 Aug 2023 06:41:22 GMT</pubDate></item><item><title><![CDATA[Reply to Object query dashboard component on Thu, 13 Jul 2023 13:38:06 GMT]]></title><description><![CDATA[<p dir="auto">Good morning guys!</p>
<p dir="auto">How do you exactly display that table on a dashboard? <br />
I wrote a similar script, tested it, and it's working fine. It returns the table, as the above example.<br />
I created a new DCI on the NetXMS server, with its origin being this script. When I go to the Last Values tab, the value of this DCI is show, e.g. Table@00000142F14623E0. </p>
<p dir="auto">On the script, I can use println associated with table-&gt;rows, row-&gt;values etc. to print the table,<br />
but how do I display this table on the dashboard? I tried the Table Value element, but i didin't work.</p>
<p dir="auto">Thank you in advance.</p>
]]></description><link>https://forum.netxms.org/post/32580</link><guid isPermaLink="true">https://forum.netxms.org/post/32580</guid><dc:creator><![CDATA[Felipe]]></dc:creator><pubDate>Thu, 13 Jul 2023 13:38:06 GMT</pubDate></item><item><title><![CDATA[Reply to Object query dashboard component on Wed, 19 May 2021 02:13:25 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Victor</p>
<p dir="auto">It worked!</p>
]]></description><link>https://forum.netxms.org/post/30014</link><guid isPermaLink="true">https://forum.netxms.org/post/30014</guid><dc:creator><![CDATA[mmarin11]]></dc:creator><pubDate>Wed, 19 May 2021 02:13:25 GMT</pubDate></item><item><title><![CDATA[Reply to Object query dashboard component on Tue, 18 May 2021 15:19:50 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">object queries are for a bit different purpose. They are for selecting objects. Script in query is executed for each node and should return true or false. You can include additional fields into resulting table, but number of columns will be static.</p>
<p dir="auto">One possible solution for your task is to create script table DCI on one of the nodes (could be NetXMS server itself) that will collect data from other nodes and populate the table. Then you can put content of that table on dashboard. You can choose "do not store" option for that table DCI to avoid keeping unnecessary information in database. Script for such DCI could be following:</p>
<pre><code>result = new Table();
result-&gt;addColumn("sysName", DCI::STRING, "System Name", true);
result-&gt;addColumn("description", DCI::STRING, "Description", true);
result-&gt;addColumn("value", DCI::FLOAT, "Value");

for (node : GetAllNodes())
{
   for(dci : FindAllDCIs(node, null, "*latency*"))
   {
      value = GetDCIValue(node, dci-&gt;id);
      if (value != null)
      {
         row = result-&gt;addRow();
         result-&gt;set(row, 0, node-&gt;snmpSysName);
         result-&gt;set(row, 1, dci-&gt;description);
         result-&gt;set(row, 2, value);
      }
   }
}

return result;
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/30011</link><guid isPermaLink="true">https://forum.netxms.org/post/30011</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 18 May 2021 15:19:50 GMT</pubDate></item></channel></rss>