Icinga / Icinga/icinga-powershell-plugins

Feature Request: Invoke-IcingaCheckDirectory - Add configurable return state for empty results

Open
#486 0 comments 0 reactions 1 assignee View on GitHub

@LordHepipud is already working on this.

Since Jul 10, 2026.

enhancement
Dominant language
PowerShell
Stars
55
Forks
30
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.