check_folder_size.vbs

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rutgerjan
Posts: 2
Joined: Tue Oct 25, 2016 3:33 am

check_folder_size.vbs

Post by rutgerjan »

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?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_folder_size.vbs

Post by rkennedy »

You'll want to specify the -a argument, to pass arguments to the script. Try this -

Code: Select all

./check_nrpe -t 120 -H 10.30.1.14 -n -c check_folder_size -a c:\install 300 400
Just to note, you may need to put your c:\install and other variables in quotes.
Former Nagios Employee
rutgerjan
Posts: 2
Joined: Tue Oct 25, 2016 3:33 am

Re: check_folder_size.vbs

Post by rutgerjan »

Yes the -a argument is the solution and also put the variables in quotes. Thanks!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_folder_size.vbs

Post by rkennedy »

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.
Former Nagios Employee
Locked