From c2969a10949f0a6de33cf711ef5a8615b9d6b44d Mon Sep 17 00:00:00 2001 From: Cyberes Date: Tue, 14 Nov 2023 12:15:11 -0700 Subject: [PATCH] minor --- check_matrix_msg.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/check_matrix_msg.py b/check_matrix_msg.py index df6f601..4375ce5 100755 --- a/check_matrix_msg.py +++ b/check_matrix_msg.py @@ -69,7 +69,7 @@ async def main(args): return_msg = f'message send time was {elapsed_time} seconds' else: return_code = nagios.STATE_OK - return_msg = 'message send successful' + return_msg = f'message send successful, took {elapsed_time} seconds' print_icinga2_check_status(return_msg, return_code, perfdata=perfdata) sys.exit(return_code) @@ -87,4 +87,9 @@ if __name__ == "__main__": parser.add_argument('--critical', type=int, default=30, help='Critical level for message send time.') args = parser.parse_args() - asyncio.run(main(args)) + try: + asyncio.run(main(args)) + except Exception as e: + print(f"UNKNOWN: exception\n{e}") + print(traceback.format_exc()) + sys.exit(nagios.UNKNOWN)