Wrappings for .exe extension in nsclient.ini?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ealvarez
Posts: 1
Joined: Thu Mar 26, 2020 10:35 am

Wrappings for .exe extension in nsclient.ini?

Post 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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post 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$
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked