<?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[Getting value from ExternalParameter / ExternalMetric not working after update]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I updated our NetXMS installation from 4.2 to 4.4.5 today and have a problem with getting values from ExternalParameter.</p>
<p dir="auto">I used the following line in 4.2 to get the value of a registry key:</p>
<pre><code>ExternalParameter=RegQuery.EBTransfer720:"D:\Program Files\NetXMSAgent\custom\CheckRegKey\CheckRegKey.exe" "HKLM\SOFTWARE\WOW6432Node\Aucotec\Engineering Base\7.2.0\Server\Files" "ImageFilePath"
</code></pre>
<p dir="auto">After update the showed the following in value:<br />
'D:\Program' is not recognized as an internal or external command</p>
<p dir="auto">After some reading I found that  ExternalParameter is replaced by ExternalMetric,<br />
so I tried:</p>
<pre><code>ExternalMetric=RegQuery.EBTransfer720:"D:\Program Files\NetXMS\custom\CheckRegKey\CheckRegKey.exe" "HKLM\SOFTWARE\WOW6432Node\Aucotec\Engineering Base\7.2.0\Server\Files" "ImageFilePath"
</code></pre>
<p dir="auto">But the result us the same:  'D:\Program' is not recognized as an internal or external command</p>
<p dir="auto">Any idea what could be the reason?</p>
<p dir="auto">Regards</p>
<p dir="auto">Stefan</p>
]]></description><link>https://forum.netxms.org/topic/7839/getting-value-from-externalparameter-externalmetric-not-working-after-update</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 18:09:48 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7839.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Dec 2023 12:08:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Getting value from ExternalParameter / ExternalMetric not working after update on Thu, 14 Dec 2023 14:54:13 GMT]]></title><description><![CDATA[<p dir="auto">The problem is that single quotes are get lost somewhere during all this process. You can specify using "" which will be escaped to " in the end, e.g.:</p>
<pre><code>ExternalMetric=RegQuery.EBTransfer720:""D:\Program
 Files\NetXMS\custom\CheckRegKey\CheckRegKey.exe""
"HKLM\SOFTWARE\WOW6432Node\Aucotec\Engineering Base\7.2.0\Server\Files"
"ImageFilePath"
</code></pre>
<p dir="auto">But better way is to use new (and not yet documented) docker-style syntax:</p>
<pre><code>ExternalMetric=RegQuery.EBTransfer720:['D:\Program
 Files\NetXMS\custom\CheckRegKey\CheckRegKey.exe',
'HKLM\SOFTWARE\WOW6432Node\Aucotec\Engineering Base\7.2.0\Server\Files',
'ImageFilePath']
</code></pre>
<p dir="auto">currently that works with single quotes (') only, but in next patch release double quotes (") will also be supported.</p>
]]></description><link>https://forum.netxms.org/post/33080</link><guid isPermaLink="true">https://forum.netxms.org/post/33080</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Thu, 14 Dec 2023 14:54:13 GMT</pubDate></item><item><title><![CDATA[Reply to Getting value from ExternalParameter / ExternalMetric not working after update on Thu, 14 Dec 2023 06:56:07 GMT]]></title><description><![CDATA[<p dir="auto">I checked the agent log and after invreasing the debug level to 7; found thi. Maybe it can help identify the reason:</p>
<pre><code>2023.12.13 13:02:47.458 *D* [comm.cs.1          ] Requesting metric "RegQuery.EBTransfer720"
2023.12.13 13:02:47.458 *D* [comm.cs.1          ] H_ExternalMetric called for "RegQuery.EBTransfer720" ""D:\Program Files\NetXMSAgent\custom\CheckRegKey\CheckRegKey.exe" "HKLM\SOFTWARE\WOW6432Node\Aucotec\Engineering Base\7.2.0\Server\Files" "ImageFilePath""
2023.12.13 13:02:47.458 *D* [exec              ] RunExternal called for "RegQuery.EBTransfer720" ""D:\Program Files\NetXMSAgent\custom\CheckRegKey\CheckRegKey.exe" "HKLM\SOFTWARE\WOW6432Node\Aucotec\Engineering Base\7.2.0\Server\Files" "ImageFilePath""
2023.12.13 13:02:47.458 *D* [exec              ] RunExternal: command line is ""D:\Program Files\NetXMSAgent\custom\CheckRegKey\CheckRegKey.exe" "HKLM\SOFTWARE\WOW6432Node\Aucotec\Engineering Base\7.2.0\Server\Files" "ImageFilePath""
2023.12.13 13:02:47.473 *D* [procexec.13        ] ProcessExecutor::executeWithOutput(): process "CMD.EXE /C "D:\Program Files\NetXMSAgent\custom\CheckRegKey\CheckRegKey.exe" "HKLM\SOFTWARE\WOW6432Node\Aucotec\Engineering Base\7.2.0\Server\Files" "ImageFilePath"" started (PID=14800)
2023.12.13 13:02:47.739 *D* [procexec.13        ] ProcessExecutor::readOutput(): stopped on GetOverlappedResult (The pipe has been ended.)
2023.12.13 13:02:47.739 *D* [procexec.13        ] ProcessExecutor::stop(): cannot terminate process (Access is denied.)
2023.12.13 13:02:47.739 *D* [comm.cs.1          ] GetMetricValue("RegQuery.EBTransfer720"): 0 (SUCCESS) value = "'D:\Program' is not recognized as an internal or external command,"
2023.12.13 13:02:47.739 *D* [comm.cs.1          ] Sending message CMD_REQUEST_COMPLETED (ID 3839; size 112; uncompressed)
</code></pre>
<p dir="auto">To me it looks like Net XMS is adding a CMD.EXE /C before my command, witch I don't understand. Shoudn't this be only the case if I use ExternalMetricShellExec?</p>
]]></description><link>https://forum.netxms.org/post/33075</link><guid isPermaLink="true">https://forum.netxms.org/post/33075</guid><dc:creator><![CDATA[stoffmann]]></dc:creator><pubDate>Thu, 14 Dec 2023 06:56:07 GMT</pubDate></item></channel></rss>