Closed FranckSallet closed 2 months ago
do you have an example?
just create a powershell script like 'check_default_arg_value.ps1' with this content:
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]$Arg1,
[Parameter(Mandatory=$false)]$Arg2
)
Write-Host $Arg1
Write-Host $Arg2
declare the script in snclient.ini like:
check_default_arg_value = check_default_arg_value.ps1 '$ARG1$' '$ARG2$'
run the check without argument:
root@nagios:/usr/lib/nagios/plugins# ./check_nrpe -H 91.188.75.98 -c check_default_arg_value
$ARG1$
$ARG2$
before the last release:
root@nagios:/usr/lib/nagios/plugins# ./check_nrpe -H 91.188.75.98 -c check_default_arg_value
$
$
thanks for pointing this out, should be an empty string with the next release now.
Hello,
I went from version 0.17 to version 0.23 on Windows. I notice a change in the value of the arguments when no values are specified in the check_command for CheckExternalScripts.
in version 0.17, the default value for an empty argument was "$" (like nsclient by the way) in version 0.23, the default value for an empty argument is "$ARG1$" (for the first argument)
Is this intended behavior?
I suggest not sending anything, this will allow you to better manage the arguments in the scripts, notably PowerShell
Thanks, Franck