Page 1 of 1

Wrappings for .exe extension in nsclient.ini?

Posted: Thu Mar 26, 2020 12:26 pm
by ealvarez
Hi there,

I'm writing a custom plugin that'll run on a Windows server where nsclient is already installed and working. I'm trying to build a dot net plugin (a dot net console application) rather than a javascript plugin here.

In nsclient.ini I have the following (the dot net binary to run is NC_InterfaceDHL.exe, aliased as valida_log):

[/settings/external scripts/wrappings]
bat = scripts\\%SCRIPT% %ARGS%
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command –
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%
js = cscript.exe //T:30 //NoLogo %SCRIPT% %ARGS%

[/settings/external scripts/wrapped scripts]
valida_log = scripts\\dhl\\NC_InterfaceDHL.exe $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$

[/settings/external scripts/alias]
alias_valida_log = valida_log

For now I am getting an error on the nsclient log file:

error:c:\source\master\modules\CheckExternalScripts\script_provider.cpp:39: Failed to find wrapping for type: exe

So I guess I need to add something to the [/settings/external scripts/wrappings] section of nsclient.ini in order to support .exe files, but I don't know what to add here.

Any help is greatly appreciated, thank you.

Re: Wrappings for .exe extension in nsclient.ini?

Posted: Mon Mar 30, 2020 4:58 pm
by Box293
I suspect the issue is this:
ealvarez wrote:[/settings/external scripts/wrapped scripts]
valida_log = scripts\\dhl\\NC_InterfaceDHL.exe $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$
It's not actually a wrapped script.

This example here:
https://docs.nsclient.org/reference/che ... alScripts/

Code: Select all

[/settings/external scripts/scripts/fix_problem]
command = notepad.exe
So perhaps you want:

Code: Select all

[/settings/external scripts/scripts/valida_log]
command = scripts\\dhl\\NC_InterfaceDHL.exe $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$