From 9c1ee0878dd401d608e05ad5154c5b1dcfae3cd2 Mon Sep 17 00:00:00 2001 From: Cyberes <64224601+Cyberes@users.noreply.github.com> Date: Wed, 3 May 2023 12:28:50 -0600 Subject: [PATCH] Update check_docker.py --- check_docker/check_docker.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/check_docker/check_docker.py b/check_docker/check_docker.py index 1a9d754..47d5c72 100755 --- a/check_docker/check_docker.py +++ b/check_docker/check_docker.py @@ -935,7 +935,12 @@ def perform_checks(raw_args): # Here is where all the work happens ############################################################################################# - containers = get_containers(args.containers, args.present) + try: + containers = get_containers(args.containers, args.present) + except URLError as e: + critical(f'Failed to connect to daemon: {e.reason}.') + print_results() + exit(rc) if len(containers) == 0 and not args.present: unknown("No containers names found matching criteria")