From 51137959c98e48b4047e81dee78e7bbcea376796 Mon Sep 17 00:00:00 2001 From: thesefer <20844000+thesefer@users.noreply.github.com> Date: Mon, 30 Jun 2025 10:25:10 +0200 Subject: [PATCH] FEATURE-835: Add arg to ignore given backends --- check-plugins/haproxy-status/haproxy-status | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/check-plugins/haproxy-status/haproxy-status b/check-plugins/haproxy-status/haproxy-status index de530d3c..5c6c3657 100755 --- a/check-plugins/haproxy-status/haproxy-status +++ b/check-plugins/haproxy-status/haproxy-status @@ -71,6 +71,13 @@ def parse_args(): default=DEFAULT_CRIT, ) + parser.add_argument( + '--ignore', + help='Ignores specified backends.', + dest='IGNORE', + action='append', + ) + parser.add_argument( '--insecure', help='This option explicitly allows to perform "insecure" SSL connections. ' @@ -198,6 +205,11 @@ def main(): state = STATE_OK perfdata_parts = [] table_values = [] + ignore_backends = [] + + # check ignore arg and fill + if args.IGNORE: + ignore_backends = args.IGNORE # analyze data for line in result[1:]: @@ -272,7 +284,7 @@ def main(): # Status check status_state = STATE_OK - if ha_status not in GOOD_STATUSES: + if ha_status not in GOOD_STATUSES and ha_pxname not in ignore_backends: status_state = STATE_WARN msg_parts.append(f'{ha_pxname} {ha_svname}: {ha_status}, ') state = lib.base.get_worst(status_state, state)