def check_cert(self, data, host, port, name):
expiretimestamp = cert_time_to_seconds(data['notAfter'])
delta = datetime.utcfromtimestamp(expiretimestamp) - datetime.utcnow()
+ deltastr = str(delta).split(",")
if delta < self.crit:
- print("CRIT (expires in %s) %s:%d" % (delta, name, port))
+ print("CRIT (expires in %8s,%16s) %s:%d" % (deltastr[0], deltastr[1], name, port))
return 2
elif delta < self.warn:
- print("WARN (expires in %s) %s:%d" % (delta, name, port))
+ print("WARN (expires in %8s,%16s) %s:%d" % (deltastr[0], deltastr[1], name, port))
return 1
def main():