'alert when a cert is expired'

def check_expired(self, cert_item):

    expiration = cert_item.config.get('NotAfter', None)
    if expiration:
        expiration = parser.parse(expiration)
        now = expiration.now(tzutc())
        time_to_expiration = (expiration - now).days
        if (time_to_expiration < 0):
            notes = 'Expired    on    {0}.'.format(str(expiration))
            self.add_issue(10, 'Cert    has    expired.', cert_item, notes=notes)
