From 4ef4f849bce17e57de859f26bd60f9f69daf8805 Mon Sep 17 00:00:00 2001 From: clyhtsuriva Date: Wed, 20 May 2020 09:32:27 +0200 Subject: ajout reccurence portdst dans bilan --- www/html/bilan.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/www/html/bilan.py b/www/html/bilan.py index 376f0c6..735959b 100755 --- a/www/html/bilan.py +++ b/www/html/bilan.py @@ -6,7 +6,8 @@ from fonctions import baseHTML, connexionBD, lien def index(req): req.content_type="text/html" - content=str() + ipdst=str() + portdst=str() #sql part conn=connexionBD() @@ -39,17 +40,27 @@ def index(req): cur.execute("SELECT ip_destination, COUNT(ip_destination) FROM paquet GROUP BY ip_destination") conn.commit() each_ip_dest=cur.fetchall() +# + cur.execute("SELECT port_destination, COUNT(port_destination) FROM paquet GROUP BY port_destination") + conn.commit() + each_port_dest=cur.fetchall() ### conn.close() #sql part -#loop +#loops for i in each_ip_dest : - content+=(""" + ipdst+=(""" +""" + str(i[0]) + """ +""" + str(i[1]) + """ + """) + + for i in each_port_dest : + portdst+=(""" """ + str(i[0]) + """ """ + str(i[1]) + """ """) -#loop +#loops #write the html page @@ -66,7 +77,9 @@ def index(req):
-"""+str(content)+""" +"""+str(ipdst)+""" + +"""+str(portdst)+"""
IP destinationRecurrence
Port destinationReccurrence
-- cgit v1.2.3