Make retcode the number of failed checks
This commit is contained in:
@@ -8,7 +8,6 @@ Options:
|
||||
-t SECONDS --timeout=SECONDS Timeout for SSL Handshake [default: 5]
|
||||
"""
|
||||
import logging
|
||||
from pprint import pprint
|
||||
|
||||
from docopt import docopt
|
||||
|
||||
@@ -30,7 +29,11 @@ if __name__ == "__main__":
|
||||
logging.info(f"Getting CERT from {hs}")
|
||||
results.append(check_host_certificate_expiration(hs, days_to_expiration))
|
||||
|
||||
failed = list(r for r in results if not r.check_successful)
|
||||
|
||||
if output_as_json:
|
||||
print(json_output(results))
|
||||
else:
|
||||
print(default_output(results))
|
||||
|
||||
exit(len(failed))
|
||||
|
||||
Reference in New Issue
Block a user