I checked the agent log and after invreasing the debug level to 7; found thi. Maybe it can help identify the reason:
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?
Code Select
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)
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?