aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclyhtsuriva <clyhtsuriva@gmail.com>2020-05-20 09:32:27 +0200
committerclyhtsuriva <clyhtsuriva@gmail.com>2020-05-20 09:32:27 +0200
commit4ef4f849bce17e57de859f26bd60f9f69daf8805 (patch)
treee519cf8d223f4eeb62b4e07c5f98c2aee406787c
parenta17e0652fc3b03f3496b167344b1b26fc6e39396 (diff)
ajout reccurence portdst dans bilan
-rwxr-xr-xwww/html/bilan.py23
1 files 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+=("""<tr>
+ ipdst+=("""<tr>
+<td>""" + str(i[0]) + """</td>
+<td>""" + str(i[1]) + """</td>
+ </tr>""")
+
+ for i in each_port_dest :
+ portdst+=("""<tr>
<td>""" + str(i[0]) + """</td>
<td>""" + str(i[1]) + """</td>
</tr>""")
-#loop
+#loops
#write the html page
@@ -66,7 +77,9 @@ def index(req):
<br/>
<table>
<tr><th>IP destination</th><th>Recurrence</th></tr>
-"""+str(content)+"""
+"""+str(ipdst)+"""
+<tr><th>Port destination</th><th>Reccurrence</th></tr>
+"""+str(portdst)+"""
</table>
<canvas id="protocole" width="20vh" height="40vw"></canvas>
<script src="/Chart.js"></script>