<?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[externalparameterprovider clarification]]></title><description><![CDATA[<p dir="auto">Hi, i done some research on forum to understand how to retrieve a table from powershell's script and create a dci.</p>
<p dir="auto">I found that dci's table doesn't support powershell and i can user "externalparameterprovider" on agent's file conf. But how?</p>
<p dir="auto">In my case i need to retrieve a list of virtual machine from hyper-v cluster with powershell command Get-vm. My question is how can translate columns output from powershell script and traslate on table columns on dci's table?</p>
<p dir="auto">thank you</p>
<p dir="auto">Andrea</p>
]]></description><link>https://forum.netxms.org/topic/5269/externalparameterprovider-clarification</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 10:32:37 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/5269.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 Oct 2017 07:20:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to externalparameterprovider clarification on Fri, 20 Oct 2017 14:30:42 GMT]]></title><description><![CDATA[<p dir="auto">thank you for reply, i have created the script and now works fine</p>
<p dir="auto">i share my code if anyone is interested</p>
<pre><code>ExternalTable=VMList:instanceColumns=Index;description=Tabella lista VM;separator=|:powershell C:\NetXMS\script\vm.ps1
</code></pre>
<p dir="auto">and this is my script</p>
<pre><code>$s = "Index|Name|State|Status";
$i = 1;
$vm = Get-VM;
ForEach($item in $vm)
{
  $s = $s + "`n" + $i + "|" + $($item.Name) + "|" + $($item.State) + "|" + $($item.Status) ;
  $i = $i +1;
}
echo $s;
</code></pre>
<p dir="auto">regards</p>
<p dir="auto">Andrea</p>
]]></description><link>https://forum.netxms.org/post/23243</link><guid isPermaLink="true">https://forum.netxms.org/post/23243</guid><dc:creator><![CDATA[it_user1]]></dc:creator><pubDate>Fri, 20 Oct 2017 14:30:42 GMT</pubDate></item><item><title><![CDATA[Reply to externalparameterprovider clarification on Sat, 14 Oct 2017 10:44:22 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">A very simple example I just tested using ExternalTable and PowerShell.</p>
<p dir="auto">Add this to your Agent configuration:</p>
<pre><code>ExternalTable=TableTest:instanceColumns=Index;description=Table with data;separator=|:powershell -c "\"Index|Column 01|Column 02`nIndex 01|Data 01|Data 11`nIndex 02|Data 02|Data 12\""
</code></pre>
<p dir="auto">What this does is:</p>
<ul>
<li>create an External Table called "TableTest".</li>
<li>the Instance Column is called "Index" (the column "Index" exists in the data)</li>
<li>the Description is just that, the description you see when you select this table as DCI</li>
<li>the separator is set to |, so the data you provide needs to have its columns separated by |. You could make this something else.</li>
<li>provide the actual command that generates the data. In this came a simple PowerShell command to print some text</li>
</ul>
<p dir="auto">Nothing is stopping you from calling an PowerShell script to return the data.<br />
You can also pass parameters. Just used ExternalTable(*) instead of ExternalTable and then reference the parameters as usual using $1, $2, etc.<br />
Keep in mind if you need to use actual $ in your command (e.g. $_), you need to escape the $ by writing $$ (e.g. $$_).</p>
<p dir="auto">See attached image for a screenshot of how this table looks like once it has been pulled into NetXMS.</p>
<p dir="auto">Cheers</p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000003759-Capture.jpg" alt="Capture.jpg" class="img-markdown  img-fluid" width="413" height="69" /></p>
]]></description><link>https://forum.netxms.org/post/23204</link><guid isPermaLink="true">https://forum.netxms.org/post/23204</guid><dc:creator><![CDATA[Tursiops]]></dc:creator><pubDate>Sat, 14 Oct 2017 10:44:22 GMT</pubDate></item><item><title><![CDATA[Reply to externalparameterprovider clarification on Fri, 13 Oct 2017 10:19:37 GMT]]></title><description><![CDATA[<p dir="auto">i have read about externaltable command, but with powershell i don't know what to use as column separator.</p>
<p dir="auto">I have thought also to use a csv file generate from powershell and copied on netxms server, but i don't found anything about it on user manual and on forum</p>
<p dir="auto">regards</p>
<p dir="auto">Andrea</p>
]]></description><link>https://forum.netxms.org/post/23200</link><guid isPermaLink="true">https://forum.netxms.org/post/23200</guid><dc:creator><![CDATA[it_user1]]></dc:creator><pubDate>Fri, 13 Oct 2017 10:19:37 GMT</pubDate></item><item><title><![CDATA[Reply to externalparameterprovider clarification on Fri, 13 Oct 2017 05:42:29 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I recall seeing that support for External Tables was added in a release candidate for 2.1:<br />
<a href="https://www.netxms.org/documentation/adminguide/agent-management.html?highlight=externaltable" rel="nofollow ugc">https://www.netxms.org/documentation/adminguide/agent-management.html?highlight=externaltable</a><br />
You could use this to call a PowerShell script, which returns the values in the required format.<br />
Someone else who may have already used this functionality may be able to assist further (I haven't used it).</p>
<p dir="auto">Otherwise, I am assuming you are referring to this post: <a href="https://www.netxms.org/forum/configuration/executing-powershell-with-tabel-result/" rel="nofollow ugc">https://www.netxms.org/forum/configuration/executing-powershell-with-tabel-result/</a><br />
ExternalParametersProvider will not give you an actual table DCI.<br />
But you can use it to return a number of name=value pairs, where "name" will be the parameter of your DCI and "value" the value for it.<br />
Together with an ExternalList (e.g. by taking the output of (get-Vm).Name) you could then use Instance Discovery to create DCIs for each VM and any data point you may be looking for.</p>
<p dir="auto">That actually does not rely on using ExternalParametersProvider (you could just have a number of individual ExternalParameters that take the VM Name as parameter), but it would make sense to do so. Better to call a single PowerShell every so often by the agent to pull all data you want, than to start a new PowerShell process for each individual DCI for each individual VM.</p>
<p dir="auto">The ExternalParametersProvider documentation is right above the ExternalTable one given in the link above. Just scroll up a few lines.</p>
<p dir="auto">Cheers</p>
]]></description><link>https://forum.netxms.org/post/23193</link><guid isPermaLink="true">https://forum.netxms.org/post/23193</guid><dc:creator><![CDATA[Tursiops]]></dc:creator><pubDate>Fri, 13 Oct 2017 05:42:29 GMT</pubDate></item></channel></rss>