This commit is contained in:
Cyberes 2023-11-14 12:15:11 -07:00
parent 683dba8519
commit c2969a1094
1 changed files with 7 additions and 2 deletions

View File

@ -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)