Hello,
I followed topic 37614 to check te folder size of a windows machine but having a problem when passing the arguments from the Nagios console.
nsclient.ini on the windows client:
This is working fine:
[/settings/external scripts/scripts]
check_folder_size=cscript.exe //T:30 //NoLogo scripts\check_folder_size.vbs c:\install 300 400
Now I want to pass the arguments so I change the ini file on the client:
[/settings/external scripts/scripts]
check_folder_size=cscript.exe //T:30 //NoLogo scripts\check_folder_size.vbs $ARG1$ $ARG2$ $ARG3$ ( I also tried to quote " the arguments )
This is the command from Nagios to test if the command works:
./check_nrpe -t 120 -H 10.30.1.14 -n -c check_folder_size c:\install 300 400
I get the error on Nagios console:
C:\Program Files\NSClient++\scripts\check_folder_size.vbs(30, 1) Runtimefout Microsoft VBScript: Kan het pad niet vinden ( this is dutch Runtime error MS VBS: Can't find path )
What I'm doing wrong, can somebody help me to pass the arguments. Is there something wrong with the path?
check_folder_size.vbs
Re: check_folder_size.vbs
You'll want to specify the -a argument, to pass arguments to the script. Try this -
Just to note, you may need to put your c:\install and other variables in quotes.
Code: Select all
./check_nrpe -t 120 -H 10.30.1.14 -n -c check_folder_size -a c:\install 300 400
Former Nagios Employee
Re: check_folder_size.vbs
Yes the -a argument is the solution and also put the variables in quotes. Thanks!
Re: check_folder_size.vbs
No problem, glad to hear that worked!
Going to close this one out, feel free to make a new post if you have questions in the future.
Going to close this one out, feel free to make a new post if you have questions in the future.
Former Nagios Employee