crans_bcfg2/Python/etc/cron.d/check_cert
Daniel STAN 1f5131aeb7 [check_cert] vérification des dates des certifs
En faisant une connexion directe tcp. Du coup, ça ne marche pas
pour tous les services utilisants SSL:
 * freeradius (key pour le wifi) utilise de l'UDP donc est hors jeu.
 * xmpp : le protocole du serveur n'a pas l'air reconnu

Il faudrait aussi regrouper tout ça sous un groupe commun.
2013-02-14 03:06:36 +01:00

23 lines
575 B
Python

# -*- coding: utf-8; mode: python -*-
info["owner"] = "root"
info["group"] = "root"
info["perms"] = 0644
header("Check SSL certificates")
def check_cert(host='localhost', port=443, user="www-data"):
print "42 7 * * * %(user)s /usr/scripts/utils/check_cert.py %(host)s %(port)s" %\
{ 'host': host,
'port': port,
'user': user,
}
if has('https-server') or has('https_cert'):
check_cert('localhost', 443, 'www-data')
if has('bcfg2-server'):
check_cert('localhost', 6789)
if has('asterisk'):
check_cert('localhost', 5061)