Hi,
currently Invoke-IcingaCheckDirectory does not provide a way to define the plugin state when no files match the specified filter. The plugin returns [OK] even though the file declared in FileNames does not exist in the specified path. Only if the directory itself is not found does the plugin return an unknown.
My suggestion would be to introduce a parameter that allows configuring the plugin state when no files match the filter.
It should be able to monitor whether a specified file exists in a directory.
File exists → Check evaluates normally.
File does not exist → Return [CRITICAL] (or another configurable state).
NSClient++ CheckDisk(check_files) provides a comparable option called empty-state, described as:
"Return status to use when nothing matched filter."
Having a similar feature would make the return state more flexibel in cases of not found files.
You would not interfere with other filter options which could still return a warning even though you want to explicitly return a critical when the file itself is not found.
Thanks for considering
Max
Hi,
currently Invoke-IcingaCheckDirectory does not provide a way to define the plugin state when no files match the specified filter. The plugin returns [OK] even though the file declared in FileNames does not exist in the specified path. Only if the directory itself is not found does the plugin return an unknown.
My suggestion would be to introduce a parameter that allows configuring the plugin state when no files match the filter.
It should be able to monitor whether a specified file exists in a directory.
File exists → Check evaluates normally.
File does not exist → Return [CRITICAL] (or another configurable state).
NSClient++ CheckDisk(check_files) provides a comparable option called empty-state, described as:
"Return status to use when nothing matched filter."
Having a similar feature would make the return state more flexibel in cases of not found files.
You would not interfere with other filter options which could still return a warning even though you want to explicitly return a critical when the file itself is not found.
Thanks for considering
Max