From 88c62dc13d0a414f624bafda91f8de64a00f7039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Didier=20Clermont=C3=A9?= Date: Wed, 18 Sep 2019 23:03:33 +0200 Subject: [PATCH] Added user count with ipv4 or ipv6 --- tools/rapport_activite.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/rapport_activite.sh b/tools/rapport_activite.sh index c23c62a..a8b54b1 100755 --- a/tools/rapport_activite.sh +++ b/tools/rapport_activite.sh @@ -68,12 +68,17 @@ generateReport() databaseSize=$(mysql --silent -u root date_chapril_org_db -e "SELECT round(sum(data_length+index_length)/1024/1024,3) AS 'Size (MB)' FROM information_schema.tables WHERE table_schema='date_chapril_org_db';" ) echo "Taille de la base de données = $databaseSize MB" - ipTotalCount=$(zgrep -h "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-access.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/date.chapril.org/date.chapril.org-access.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" - + ipv4Count=$(zgrep -h "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-access.log*|grep "$year"|grep -vi bot|grep -v check_http|grep '^\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\} '|cut -d' ' -f1|sort|uniq |wc -l) + echo "Nombre d'ipv4 ayant visité le service = $ipv4Count" + + ipv6Count=$(zgrep -h "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-access.log*|grep "$year"|grep -vi bot|grep -v check_http|grep '^\([0-9a-f]\{0,4\}:\)\{2,7\}\([0-9a-f]\{0,4\}\)\{1\} '|cut -d' ' -f1|sort|uniq |wc -l) + echo "Nombre d'ipv6 ayant visité le service = $ipv6Count" + + ipv4UserCount=$(zgrep -h "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-access.log*|grep "$year"|grep -vi bot|grep -v check_http|grep '^\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\} '|grep -v "GET \(/.git/|/img/|/i18n/|/js/|/fonts/|/css/\|/images/\| /\)"|grep -v "HTTP/1.0\" 404"|grep -v "HEAD"|grep -v "GET /"|cut -d' ' -f1|sort|uniq|wc -l ) + echo "Nombre d'ipv4 utilisatrices = $ipv4UserCount" + + ipv6UserCount=$(zgrep -h "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-access.log*|grep "$year"|grep -vi bot|grep -v check_http|grep '^\([0-9a-f]\{0,4\}:\)\{2,7\}\([0-9a-f]\{0,4\}\)\{1\} '|grep -v "::1 "|grep -v "GET \(/.git/|/img/|/i18n/|/js/|/fonts/|/css/\|/images/\| /\)"|grep -v "HTTP/1.0\" 404"|grep -v "HEAD"|grep -v "GET /"|cut -d' ' -f1|sort|uniq|wc -l ) + echo "Nombre d'ipv6 utilisatrices = $ipv6UserCount" echo -e "\n" }