From 4d12ffbc4fa40134672b9496e5f5fd5963d658b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Didier=20Clermont=C3=A9?= Date: Tue, 30 Jul 2019 12:14:18 +0200 Subject: [PATCH] Added statistics on users'ip (#3807) --- tools/rapport_activite.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/rapport_activite.sh b/tools/rapport_activite.sh index 822a234a..c2282ad5 100755 --- a/tools/rapport_activite.sh +++ b/tools/rapport_activite.sh @@ -1,3 +1,4 @@ + #!/bin/bash # # Copyright (C) 2018, 2019 Didier Clermonté @@ -64,7 +65,15 @@ generateReport() pasteCount=$(find /var/www/paste.chapril.org/data -mindepth 3 -maxdepth 3 -type f | wc -l) echo "Nombre de pastes dans la base actuellement = $pasteCount" - echo + + ipTotalCount=$(zgrep -h "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-acces.log*|grep "$year"|grep -vi bot|grep -v check_http|cut -d' ' -f1|sort|uniq |wc -l) + echo "Nombre d'ip visiteuses = $ipTotalCount" + + ipUtilCount=$(zgrep -h "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-acces.log*|grep "$year"|grep -vi bot|grep -v check_http|grep -v "GET /fonts/"|grep -v "GET \(/css/\|/images/\|/ \)"|grep -v "GET /js/"|grep -v "HTTP/1.0\" 404"|cut -d' ' -f1|sort|uniq| wc -l ) + echo "Nombre d'ip utilisatrices = $ipUtilCount" + + echo -e "\n" + } @@ -125,3 +134,4 @@ else echo -e "Bad parameter." help fi +