Improve error handling when remote check fails

This commit is contained in:
Lance Edgar 2022-01-28 17:02:36 -06:00
parent 602848cd9d
commit dec2561db2

View file

@ -108,7 +108,11 @@ if __name__ == '__main__':
# Ok now connect, and try to get values for memory # Ok now connect, and try to get values for memory
client = schecks.connect(hostname, port, ssh_key_file, passphrase, user) client = schecks.connect(hostname, port, ssh_key_file, passphrase, user)
result, exitcode = execute_check(client, check_path) result = execute_check(client, check_path)
if result is False:
print result print("failed to execute remote check!")
sys.exit(exitcode) sys.exit(3)
else:
output, exitcode = result
print(output)
sys.exit(exitcode)