Path and list all files in a directory

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
Maxwellb99
Posts: 97
Joined: Tue Jan 26, 2016 5:29 pm

Path and list all files in a directory

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Path and list all files in a directory

Post by hsmith »

Can you try to wrap the $ARG$ in quotes?
Former Nagios Employee.
me.
Maxwellb99
Posts: 97
Joined: Tue Jan 26, 2016 5:29 pm

Re: Path and list all files in a directory

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Path and list all files in a directory

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