Hi Scott,
My bad. I haven't checked the plugin options in detail. The plugin already has the instance name to be supplied as argument.
So, when I execute the below command in the powershell of the target server, it does give me the failed SQL jobs.
Please find below:
Code: Select all
PS C:\Program Files\NSClient++\scripts> .\check_mssql.ps1 'Jobs' 'INST01'
Critical: Total failed: 12. Job: names of all jobs
However, When I run the NRPE check from Nagios server terminal, it gives the below error.
Code: Select all
./check_nrpe -H "server_name" -t 30 -c check_mssql -a '-CheckType Jobs -InstanceName INST01'
CHECK_NRPE: Invalid packet type received from server.
Below are the settings done in nsclient++.ini
[/settings/external scripts/scripts]
check_mssql=cmd /c echo scripts\check_mssql.ps1 $ARG1$ ; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
; POWERSHELL WRAPPING -
ps1 = cmd /c echo scripts\%SCRIPT%%ARGS%; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
I think I am missing out in supplying the proper args in the nsclient++.ini file.
Could you please have a look and correct me please.