Hello,
Does anyone know how to specify a path wildcard for check_files command? I'm trying to create a check command in such manner:
"check_nrpe -a check_files path=c:/foo/*/test/ pattern=*.exe" in such case there is no valid response.
"check_nrpe -a check_files path=c:/foo/foo2/test/ pattern=*.exe" status is OK, files are found.
Thanks in advice!
Wildcard for Windows path in check_files command
Re: Wildcard for Windows path in check_files command
What version of NSClient++ is installed on this Windows machine? A lot of NSClient++ command interactions are heavily dependent on the NSClient++ version involved.
The general answer to this question is to leverage the max-depth argument for the CheckDisk/CheckFiles module within NSClient++:
And a max-depth of 2, file1.exe and file2.exe would match. file3.exe would not match. If you set your max-depth to 3 (or greater), all files would match. +/- 1 maybe, because I don't remember *exactly* how that parameter works and the documentation is vague, but you get the idea? Here's an older post I made on this topic with some sample commands:
https://support.nagios.com/forum/viewto ... 22#p189522
More info:
https://docs.nsclient.org/reference/windows/CheckDisk/
The general answer to this question is to leverage the max-depth argument for the CheckDisk/CheckFiles module within NSClient++:
Assuming you had a file tree like this:max-depth Maximum depth to recurse
Code: Select all
{
"C:": {
"foo": [
"file1.exe",
"file2.exe"
]
"bar": {
"baz": [
"file3.exe"
]
}
}
}
https://support.nagios.com/forum/viewto ... 22#p189522
More info:
https://docs.nsclient.org/reference/windows/CheckDisk/
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Wildcard for Windows path in check_files command
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.