Code: Select all
./check_nrpe -H 192.168.30.64 -t 60 -c topcpu -a 'vm-restore-cy1 memwarn 85 memcrit 95'Code: Select all
./check_nrpe -H 192.168.30.64 -t 60 -c topcpu -a 'vm-restore-cy1 memwarn 85 memcrit 95'if i use -a then i am getting this error :WillemDH wrote:Try again like this:
Code: Select all
./check_nrpe -H 192.168.30.64 -t 60 -c topcpu -a 'vm-restore-cy1 memwarn 85 memcrit 95'
Code: Select all
[/settings/external scripts]
allow arguments = true
allow nasty characters = trueI have added the above lines, but i am not getting the outpu, still getting the same error :WillemDH wrote:You need this:
Code: Select all
[/settings/external scripts] allow arguments = true allow nasty characters = true
Code: Select all
[/settings/external scripts]
allow arguments = 1
allow nasty characters=1Code: Select all
cd "C:\Program Files\NSClient++
nscp settings --generate --add-defaults --load-all
I have already copied files to Script folder , added lines to nsclinet. but still issue is there.is there anything i am missing??lmiltchev wrote:Did you copy the script from "C:\Program Files\NSClient++\plugins" back to "C:\Program Files\NSClient++\scripts" directory?
Also, you allow arguments under the NRPE section but they need to be allowed under the external scripts section, too. In my nsclient.ini, I have:
You may need to add this section, and restart NSClient++ service.Code: Select all
[/settings/external scripts] allow arguments = 1 allow nasty characters=1
BTW, if you want to load all of the defaults in the nsclient.ini, open CMD prompt, and run:
Code: Select all
cd "C:\Program Files\NSClient++ nscp settings --generate --add-defaults --load-all
Code: Select all
topcpu = cmd /c scripts\resourcecheck.ps1 $ARG1$; exit $LastExitcode | powershell.exe -commandCode: Select all
topcpu = cmd /c echo scripts\resourcecheck.ps1 $ARG1$; exit $LastExitcode | powershell.exe -command -Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.30.64 -t 60 -c topcpu -a 'vm-restore-cy1 -memwarn 85 -memcrit 95'when i am running this command :lmiltchev wrote:Change your command in the nsclient.ini from this:to this:Code: Select all
topcpu = cmd /c scripts\resourcecheck.ps1 $ARG1$; exit $LastExitcode | powershell.exe -commandNote: Add "echo" before scripts, and "-" after "command" (with a space between them).Code: Select all
topcpu = cmd /c echo scripts\resourcecheck.ps1 $ARG1$; exit $LastExitcode | powershell.exe -command -
Restart NSClient++ service.
Do you see any errors when you run the check now?
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.30.64 -t 60 -c topcpu -a 'vm-restore-cy1 -memwarn 85 -memcrit 95'
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.30.64 -c topcpu -a 'vm-restore-cy1 -memwarn 85 -memcrit 95'Here is the output which you have asked :lmiltchev wrote:Can you copy/paste this command to your putty window and show the output of it?Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.30.64 -c topcpu -a 'vm-restore-cy1 -memwarn 85 -memcrit 95'