From b491a9c25f43e0d2317cb21b3a57a0290854fdc5 Mon Sep 17 00:00:00 2001 From: "S.Bay (Space2Place)" Date: Wed, 20 May 2026 14:05:25 +0200 Subject: [PATCH 1/2] Better ICINGA Webui output --- check-plugins/file-count/file-count | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/check-plugins/file-count/file-count b/check-plugins/file-count/file-count index a3cd6385d..975ad22c0 100755 --- a/check-plugins/file-count/file-count +++ b/check-plugins/file-count/file-count @@ -309,6 +309,15 @@ def main(): _min=0, ) + state_text = { + STATE_OK: 'OK', + STATE_WARN: 'WARNING', + STATE_CRIT: 'CRITICAL', + STATE_UNKNOWN: 'UNKNOWN' + }.get(state, 'UNKNOWN') + + msg = f'[{state_text}] {msg}' + # over and out lib.base.oao(msg, state, perfdata, always_ok=args.ALWAYS_OK) From 53a1c09c94f7b6c0f2ff3dd0a9f849c2a583183c Mon Sep 17 00:00:00 2001 From: "S.Bay (Space2Place)" Date: Wed, 20 May 2026 14:08:59 +0200 Subject: [PATCH 2/2] New argument --no-early-break to disable the early break --- check-plugins/file-count/file-count | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/check-plugins/file-count/file-count b/check-plugins/file-count/file-count index 975ad22c0..a266e9b27 100755 --- a/check-plugins/file-count/file-count +++ b/check-plugins/file-count/file-count @@ -91,6 +91,14 @@ def parse_args(): default=False, ) + parser.add_argument( + '--no-early-break', + help='Disable early break optimization and count all matching files.', + dest='NO_EARLY_BREAK', + action='store_true', + default=False, + ) + parser.add_argument( '--password', help='Password for SMB authentication.', @@ -202,7 +210,10 @@ def main(): exceeded_threshold = False # Determine if we can break early for performance - early_break_at = get_early_break_threshold(args.WARN, args.CRIT) + if args.NO_EARLY_BREAK: + early_break_at = None + else: + early_break_at = get_early_break_threshold(args.WARN, args.CRIT) if args.FILENAME: path = Path(args.FILENAME) @@ -293,7 +304,8 @@ def main(): display_count = file_count - 1 msg = ( f'Found more than {display_count} matching ' - f'{lib.txt.pluralize("file", display_count)} (thresholds {args.WARN}/{args.CRIT})' + f'{lib.txt.pluralize("file", display_count)} ' + f'(thresholds {args.WARN}/{args.CRIT}, early-break active)' ) else: msg = (