You are here

arguments, passed through NRPE

2 posts / 0 new
Last post
TenderCorp's picture
arguments, passed through NRPE

I have been trying to setup a Power Shell Script to Monitor our Exchange 2013 Server and the Arguments that I'm passing in the command are not working.


Here is the line I added to the custom.ini file to call the script

[External Scripts]
exchange_serverhealth=cmd /c echo scripts\exchange-serverhealth.ps1 -HealthSet $ARG1$ -Server $ARG2$; exit($lastexitcode) | powershell.exe -command -

This is the Command I have setup in Opsview Service Check:

-H $HOSTADDRESS$ -t 240 -c exchange_serverhealth -a HubTransport $HOSTADDRESS$

I can run the Powershell on the server just fine.

If I change the custom.ini file to hard code the Arguments the command works fine.  This is what I tried in the custom.ini

[External Scripts]
exchange_serverhealth=cmd /c echo scripts\exchange-serverhealth.ps1 -HealthSet HubTransport -Server ServerName; exit($lastexitcode) | powershell.exe -command -

It looks like all I'm getting for the Arguments is a $.

Is there a way to increase the logging in the client so I can see the exact command that it is running?

Do you see anythign incorrect in the setup of the custom.ini and also the command in the service check?





feytullahede's picture


Did you enable argument passing? (allow_arguments=1 or allow arguments = true )

And you can look at nsclient.log for an error like arguments or something else.