Check_nrpe - Directory with spaces
Posted: Thu Aug 07, 2014 12:50 pm
I have been trying to use check_files.vbs to return the number of files in a given directory. This works perfectly, only if the directory does not have spaces. I have tried every combination of quotes, double quotes, slashes, back slashes and each one gives me either an illegal character error or a path not found. I came across this http://support.nagios.com/forum/viewtop ... f=7&t=4195 but even hardcoded into the command I get an illegal character.
Here is what works.
From command line on nagios server:
./check_nrpe -H 192.168.201.6 -c check_files -a /path:Z:\Test /searchdepth:1 /selage:ignore /warning:4 /critical:5
From normal usage:
define command{
command_name check_nrpe_external
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
define service{
use generic-service
host_name Images1
service_description FC To Webfeeds
check_command check_nrpe_external!check_files!/path:Z:\Test /searchdepth:1 /selage:ignore /warning:4 /criticical:5
}
Both the above work. The only thing that needs to change is the path. To something like Z:\Folder one\Folder two\Folder three
If anyone can tell me if this is at least possible. Double quotes, double back slashes seem to give me illegal character errors.
Thanks
Bruce
Here is what works.
From command line on nagios server:
./check_nrpe -H 192.168.201.6 -c check_files -a /path:Z:\Test /searchdepth:1 /selage:ignore /warning:4 /critical:5
From normal usage:
define command{
command_name check_nrpe_external
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
define service{
use generic-service
host_name Images1
service_description FC To Webfeeds
check_command check_nrpe_external!check_files!/path:Z:\Test /searchdepth:1 /selage:ignore /warning:4 /criticical:5
}
Both the above work. The only thing that needs to change is the path. To something like Z:\Folder one\Folder two\Folder three
If anyone can tell me if this is at least possible. Double quotes, double back slashes seem to give me illegal character errors.
Thanks
Bruce