Hi,
Using check_files I can specify a pattern to filter the files by extension and this works:
./check_nrpe -H 192.168.1.1 -c check_files -a path="D:\\Testing" pattern="*.txt"
I need to be able to find files that match one of three extensions: txt pdf csv
I have tried specifying multiple file extensions however this does not work.
./check_nrpe -H 192.168.1.1 -c check_files -a path="D:\\Testing" pattern="*.txt" pattern="*.pdf" pattern="*.csv"
check_files by extension
Re: check_files by extension
Which version of NSClient++ is your remote Windows machine running? This is somewhat important.
You might consider using a proper filter instead of the pattern directive:
https://docs.nsclient.org/reference/win ... ilter_keys
I haven't tested this at all, but depending on your NSClient++ version it might work:
You might consider using a proper filter instead of the pattern directive:
https://docs.nsclient.org/reference/win ... ilter_keys
I haven't tested this at all, but depending on your NSClient++ version it might work:
Code: Select all
./check_nrpe -H 192.168.1.1 -c check_files -a path="D:\\Testing" filter="filename regexp '^.*\.(txt)|(pdf)|(csv)'"
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: check_files by extension
Slight tweak to get it to work
"filter=filename regexp '/^.*\.(txt|TXT|pdf|PDF|csv|CSV)'"
Could not get the /i to work so had to include both cases
Using newest version of NSClient
"filter=filename regexp '/^.*\.(txt|TXT|pdf|PDF|csv|CSV)'"
Could not get the /i to work so had to include both cases
Using newest version of NSClient
Re: check_files by extension
Thanks for the update. I'm not sure what type of regex is used by nsclient but I've had similar problems getting $ to work properly.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: check_files by extension
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.