You are here

NRPE arguments

2 posts / 0 new
Last post
willetzky
willetzky's picture
NRPE arguments

Hi

 

I am trying to use a powershell script via check_nrpe but the arguments are not passwed to the script

Check i run

 /usr/lib/nagios/plugins/check_nrpe -H "servername1" -c check_diskmp -a '10'

agent ini has the following in external scripts

check_diskmp=cmd /c echo scripts\check_diskmp.ps1 -Critical $ARG1$ -Warning "20"; exit $LastExitCode | powershell.exe -command -#

allow_arguments=1 is in the ini file

 

 

I get the following error

C:\Program Files\Opsview Agent\scripts\check_diskmp.ps1 : Cannot process
argument transformation on parameter 'Critical'. Cannot convert value "$" to
type "System.Int32". Error: "Input string was not in a correct format."
At line:1 char:36
+ scripts\check_diskmp.ps1 -Critical $ARG1$ -Warning "20"; exit $LastExitCode
+                                    ~~~~~~
    + CategoryInfo          : InvalidData: (:) [check_diskmp.ps1], ParameterBi
   ndingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,check_diskm
   p.ps1

 

it seesms to be passing $ARG1$ intead of what is in argument 1

 

willetzky
willetzky's picture
i managed to fix this by

i managed to fix this by adding the following to the ini. It needs its own area External Script not in the External Scripts

[External Script]
allow_arguments=1