Page 1 of 1

Path and list all files in a directory

Posted: Tue Jan 26, 2016 5:41 pm
by Maxwellb99
Hello,

I'm trying to list the files in a directory. Right now I'm using check_nrpe and check_files.

I got it to work from the command line and when I hardcode the path and pattern into centreon.

Code: Select all

$USER1$/check_nrpe -H **.**.*.** -c check_files -a path='C:\Program Files\Internet Explorer\' pattern=*.dll show-all


However, when i replace the values with ARG's it either returns no files found or Files\Internet is not an option. Any help would be appreciated!

Code: Select all

$USER1$/check_nrpe -H $ARG1$ -c check_files -a path=$ARG2$ pattern=$ARG3$ show-all

$ARG1$ **.**.*.**
$ARG2$ C:\Program Files\Internet Explorer\
$ARG3$*.dll

I'm pretty sure it's something wrong with my ARG2 But, they could all be wrong :lol:

Thank you for your help!
Max

Re: Path and list all files in a directory

Posted: Wed Jan 27, 2016 10:23 am
by hsmith
Can you try to wrap the $ARG$ in quotes?

Re: Path and list all files in a directory

Posted: Wed Jan 27, 2016 2:32 pm
by Maxwellb99
Hello,

Thanks for the response! When I add single quotes around $ARG2$ centreon returns "no files found" even thought it should be the same directory. I was hoping it was a blatant filepath error on my part.

Thanks,
Max

Re: Path and list all files in a directory

Posted: Wed Jan 27, 2016 3:16 pm
by tmcdonald
Maxwellb99 wrote:When I add single quotes around $ARG2$ centreon returns "no files found"
We do not provide support for Centreon. You will need to contact them on their forums for further assistance.