<?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[issue with scripts run by ExternalParametersProvider]]></title><description><![CDATA[<p dir="auto">Hi</p>
<p dir="auto">Windows Batch Scripts executed by the ExternalParametersProvider seem to have issues when they execute other applications. In Powershell Scripts only xcopy.exe doesn't work.<br />
We are using Windows 2008 R2 as Server and Agent.<br />
NetXMS Server and Agent is on 1.2.4</p>
<p dir="auto">in cmd.exe scripts it seems like it stops executing after the first exe-application was started. this only happens when run by NetXMS Agent, when run manually in cmd.exe it always runs through</p>
<pre><code>@echo off
echo ---- MARK &gt;&gt; d:\log_files\netxms_rpc_debug_cmd.log 2&gt;&amp;1
c:\WINDOWS\System32\ping.exe localhost -n 1 &gt;&gt; d:\log_files\netxms_rpc_debug_cmd.log 2&gt;&amp;1
c:\WINDOWS\System32\findstr.exe csax d:\csaxtext?.txt &gt;&gt; d:\log_files\netxms_rpc_debug_cmd.log 2&gt;&amp;1
c:\WINDOWS\System32\robocopy.exe d:\ c:\ csaxtext3.txt /NJH /NP &gt;&gt; d:\log_files\netxms_rpc_debug_cmd.log 2&gt;&amp;1
c:\WINDOWS\System32\xcopy.exe d:\csaxtext3.txt c:\ /Y &gt;&gt; d:\log_files\netxms_rpc_debug_cmd.log 2&gt;&amp;1
echo DEBUG_CMD=SOMEVALUE &gt;&gt; d:\log_files\netxms_rpc_debug_cmd.log 2&gt;&amp;1
</code></pre>
<p dir="auto">when you change order of commands, the first one is executed with proper output, the rest is not.<br />
interestingly, xcopy does not work at all, no output, no copy but still stops execution<br />
the output of the above script is:</p>
<blockquote>
<p dir="auto">---- MARK </p>
<p dir="auto">Pinging localhost [127.0.0.1] with 32 bytes of data:<br />
Reply from 127.0.0.1: bytes=32 time&lt;1ms TTL=128</p>
<p dir="auto">Ping statistics for 127.0.0.1:<br />
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),<br />
Approximate round trip times in milli-seconds:<br />
    Minimum = 0ms, Maximum = 0ms, Average = 0ms</p>
</blockquote>
<p dir="auto">in powershell all but xcopy work. xcopy won't stop the execution of the hole script but it doesn't do anything and does not show any output. If run manually, it works as expected.</p>
<pre><code>"---- MARK" | ac d:\log_files\netxms_rpc_debug_ps.log
c:\WINDOWS\System32\ping.exe localhost -n 1 | ac d:\log_files\netxms_rpc_debug_ps.log
c:\WINDOWS\System32\xcopy.exe d:\csaxtext3.txt c:\ /Y | ac d:\log_files\netxms_rpc_debug_ps.log
c:\WINDOWS\System32\findstr.exe csax d:\csaxtext?.txt | ac d:\log_files\netxms_rpc_debug_ps.log
c:\WINDOWS\System32\robocopy.exe d:\ c:\ csaxtext3.txt /NJH /NP | ac d:\log_files\netxms_rpc_debug_ps.log
"DEBUG_PS=SOMEVALUE"| ac d:\log_files\netxms_rpc_debug_ps.log
</code></pre>
<p dir="auto">output</p>
<blockquote>
<p dir="auto">---- MARK</p>
<p dir="auto">Pinging <a href="http://app01.intra.arcplace.ch" rel="nofollow ugc">app01.intra.arcplace.ch</a> [127.0.0.1] with 32 bytes of data:<br />
Reply from 127.0.0.1: bytes=32 time&lt;1ms TTL=128</p>
<p dir="auto">Ping statistics for 127.0.0.1:<br />
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),<br />
Approximate round trip times in milli-seconds:<br />
    Minimum = 0ms, Maximum = 0ms, Average = 0ms<br />
d:\csaxtext3.txt:csax-test</p>
<p dir="auto">                       1	d:\</p>
<p dir="auto">------------------------------------------------------------------------------</p>
<p dir="auto">               Total    Copied   Skipped  Mismatch    FAILED    Extras<br />
    Dirs :         1         0         1         0         0         0<br />
   Files :         1         0         1         0         0         0<br />
   Bytes :        11         0        11         0         0         0<br />
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00</p>
<p dir="auto">   Ended : Wed Nov 14 15:58:30 2012<br />
DEBUG_PS=SOMEVALUE</p>
</blockquote>
<p dir="auto">Agent Config:</p>
<pre><code>LogFile = D:\log_files\netxms_agent.log
DebugLevel = 9
FileStore = C:\NetXMS\var
SubAgent = ecs.nsm
SubAgent = ping.nsm
SubAgent = logwatch.nsm
SubAgent = portcheck.nsm
SubAgent = winperf.nsm
SubAgent = wmi.nsm
ExternalParametersProvider=powershell.exe d:\cmd_files\netxms_rpc_debug.ps1:5
ExternalParametersProvider=d:\cmd_files\netxms_rpc_debug.cmd:5
</code></pre>
<p dir="auto">In the Agent Debug(level 9) logs i was unable to find detailed information about the execution of ExternalParamtersProvider only the DCIs requesting their parameters.<br />
i tested this on two Windows 2008 R2 systems with same agent version. one is part of a domain, the other is not.</p>
<p dir="auto">i appreciate any ideas.<br />
in the end, i need the xcopy in powershell to generate a list of remote files older than a specific date (xcopy /L /D:DATE)</p>
]]></description><link>https://forum.netxms.org/topic/2026/issue-with-scripts-run-by-externalparametersprovider</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 09:04:03 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/2026.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Nov 2012 15:12:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to issue with scripts run by ExternalParametersProvider on Fri, 16 Nov 2012 13:59:54 GMT]]></title><description><![CDATA[<p dir="auto">Hi</p>
<p dir="auto">just tried to run the agent from the commandline:<br />
"C:\NetXMS\bin\nxagentd.exe" -c "C:\NetXMS\etc\nxagentd.conf" -n "NetXMSAgentdW32" -e "NetXMS Win32 Agent" -D 0</p>
<p dir="auto">now it works!<br />
what's the difference?</p>
<p dir="auto">usually the agent runs as a windows service using Active Directory user credentials to be able to access network ressources. the user i did run it from the commandline.</p>
]]></description><link>https://forum.netxms.org/post/8950</link><guid isPermaLink="true">https://forum.netxms.org/post/8950</guid><dc:creator><![CDATA[AP_ops]]></dc:creator><pubDate>Fri, 16 Nov 2012 13:59:54 GMT</pubDate></item><item><title><![CDATA[Reply to issue with scripts run by ExternalParametersProvider on Thu, 15 Nov 2012 12:40:42 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">I try to reproduce this issue, but everything is working on my test system. How do you run agent? Did you try to run it from command line in foreground?</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/8948</link><guid isPermaLink="true">https://forum.netxms.org/post/8948</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Thu, 15 Nov 2012 12:40:42 GMT</pubDate></item></channel></rss>