Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion check-plugins/haproxy-status/haproxy-status
Original file line number Diff line number Diff line change
Expand Up @@ -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. '
Expand Down Expand Up @@ -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:]:
Expand Down Expand Up @@ -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)
Expand Down