From 889547580ae527235a013c5a0844813932fa74d6 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sat, 6 Apr 2013 14:56:43 +0200 Subject: [PATCH] =?UTF-8?q?[deconnexion]=20Lorsque=20que=20deux=20macs=20u?= =?UTF-8?q?tilisent=20la=20m=C3=AAme=20ipv6=20sur=20un=20interval=20de=20t?= =?UTF-8?q?rois=20jours,=20on=20affiche=20l'ipv6=20et=20les=20deux=20macs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- surveillance/deconnexion.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/surveillance/deconnexion.py b/surveillance/deconnexion.py index c3b643ee..e28f4fd8 100755 --- a/surveillance/deconnexion.py +++ b/surveillance/deconnexion.py @@ -167,14 +167,15 @@ uploadeurs = curseur.fetchall() # On regarde s'il y a deux ipv6 identiques avec des mac non identiques -collision_mac_ip_request = "SELECT DISTINCT (a.*) FROM mac_ip as a, mac_ip as b where a.ip=b.ip AND a.mac != b.mac AND a.date >= b.date AND a.date - b.date < interval '3 day' ORDER BY a.date;" +collision_mac_ip_request = "SELECT DISTINCT a.date as date1, a.mac as mac1, a.ip as ip1, b.date as date2, b.mac as mac2, b.ip as ip2 FROM mac_ip as a, mac_ip as b where a.ip=b.ip AND a.mac != b.mac AND a.date >= b.date AND a.date - b.date < interval '3 day' ORDER BY a.date;" curseur.execute(collision_mac_ip_request) collision_mac_ip = curseur.fetchall() if collision_mac_ip != []: print "Collision d'addresses ipv6 : " -for (date, mac, ip) in collision_mac_ip: - print "%s %s %s" % (date, ipt.mac_addr(mac), ip) +for (date1, mac1, ip1, date2, mac2, ip2) in collision_mac_ip: + print "%s %s %s" % (date1, ipt.mac_addr(mac1), ip1) + print "%s %s %s" % (date2, ipt.mac_addr(mac2), ip2) # Table des avertis ###################