From cc94565b49cfa9a7858c46b98c8489604b2dede4 Mon Sep 17 00:00:00 2001 From: Antoine Durand-Gasselin Date: Mon, 18 May 2009 07:59:25 +0200 Subject: [PATCH] =?UTF-8?q?[parse=5Fauth=5Flog]=20lisibilit=C3=A9++?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ignore-this: e36e7d6d0500f1281d02de548600ad49 darcs-hash:20090518055925-bd074-d544b98ac60570b92b71529cf355030637dc3a56.gz --- surveillance/parse_auth_log.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/surveillance/parse_auth_log.py b/surveillance/parse_auth_log.py index 7336974e..4cccaf31 100644 --- a/surveillance/parse_auth_log.py +++ b/surveillance/parse_auth_log.py @@ -228,12 +228,15 @@ def affiche_erreurs(errs, message, min_mac=1, min_prise=1): for mac, erreur_mac in erreur_prise['macs'].items(): if erreur_mac['nombre'] >= min_mac: - print ' %s (x%d)' % (erreur_mac['lignes'][-1].strip(), - erreur_mac['nombre']) + ligne = erreur_mac['lignes'][-1].strip().split() + ligne[5] = '%8s' % ligne[5].replace("adm.crans.org-", "") + ligne = ligne[0:3] + ligne[5:] + print ' %s (x%d)' % (' '.join(ligne), erreur_mac['nombre']) info = erreur_mac['info'] if info != None: prop = info['prop'] - cprint(u' -> propriétaire de la machine: %s <%s>, prise %s (chambre %s)' % (prop.Nom(), prop.email(), info['prise'], info['chambre'])) + cprint(u' -> machine de : %-16s %5s (prise %s) <%s>' % + (prop.Nom()[:16], info['chambre'], info['prise'], prop.email())) def __usage(err=''):