ExternalParameterShellExec runs multiple times

Started by MarcusH, October 10, 2016, 11:05:29 AM

Previous topic - Next topic

MarcusH

Hi,

I have set up one node to run a file via ExternalParameterShellExec on the agent but when it executes the file it runs it 3 times, any known related problems to this?
Searched the bugtracker but could not find any.

Tested both forced DCI poll and scheduled.

Agent version 2.0.5
Windows 2012 R2

Alex Kirhenshtein

Please increase debug level to 5, reproduce problem and send us agent log

MarcusH

This is not the real file, i tested different scenarios and this test.exe is only a while loop so it stays active

[10-Oct-2016 11:01:16.251] [DEBUG] [session:0] Requesting parameter "test"
[10-Oct-2016 11:01:16.251] [DEBUG] H_ExternalParameter called for "test" "Sc:\test.exe"
[10-Oct-2016 11:01:16.251] [DEBUG] RunExternal called for "test" "Sc:\test.exe"
[10-Oct-2016 11:01:16.251] [DEBUG] RunExternal: command line is "c:\test.exe"
[10-Oct-2016 11:01:16.251] [DEBUG] RunExternal (shell exec): worker thread created
[10-Oct-2016 11:01:18.266] [DEBUG] RunExternal (shell exec): execution timeout
[10-Oct-2016 11:01:18.266] [DEBUG] RunExternal (shell exec): execution status 2
[10-Oct-2016 11:01:18.266] [DEBUG] [session:0] Requesting parameter "test"
[10-Oct-2016 11:01:18.266] [DEBUG] H_ExternalParameter called for "test" "Sc:\test.exe"
[10-Oct-2016 11:01:18.266] [DEBUG] RunExternal called for "test" "Sc:\test.exe"
[10-Oct-2016 11:01:18.266] [DEBUG] RunExternal: command line is "c:\test.exe"
[10-Oct-2016 11:01:18.266] [DEBUG] RunExternal (shell exec): worker thread created
[10-Oct-2016 11:01:20.266] [DEBUG] RunExternal (shell exec): execution timeout
[10-Oct-2016 11:01:20.266] [DEBUG] RunExternal (shell exec): execution status 2
[10-Oct-2016 11:01:20.266] [DEBUG] [session:0] Requesting parameter "test"
[10-Oct-2016 11:01:20.266] [DEBUG] H_ExternalParameter called for "test" "Sc:\test.exe"
[10-Oct-2016 11:01:20.266] [DEBUG] RunExternal called for "test" "Sc:\test.exe"
[10-Oct-2016 11:01:20.266] [DEBUG] RunExternal: command line is "c:\test.exe"
[10-Oct-2016 11:01:20.266] [DEBUG] RunExternal (shell exec): worker thread created
[10-Oct-2016 11:01:22.282] [DEBUG] RunExternal (shell exec): execution timeout
[10-Oct-2016 11:01:22.282] [DEBUG] RunExternal (shell exec): execution status 2

Alex Kirhenshtein

Well, it behaves as expected.
If you need to handle long-running command - use ExternalParameterProvider (https://wiki.netxms.org/wiki/ExternalParametersProvider)

MarcusH

That seems logical, though this external does not return data by itself it consolidates data in an external sql db for faster queries.
Can run it in windows schedule but felt more right to run it from the agent that uses it on set schedule.

The answer though solved a few other data collection dilemmas i had so thanks for that, time to rethink my data providers :)

Alex Kirhenshtein

Problem with slow external parameters is that server retrieve values in a single thread (per agent) and it can block data collection from the agent