diff --git a/roles/deploy-web/files/getinfo_week.sh b/roles/deploy-web/files/getinfo_week.sh index ad22593..a865df2 100755 --- a/roles/deploy-web/files/getinfo_week.sh +++ b/roles/deploy-web/files/getinfo_week.sh @@ -26,11 +26,13 @@ do cat $directory_host/output_*.txt |grep "${j}" |sort |uniq -c >> ${MAIL} echo "--------------" >> ${MAIL} done - echo "nombre erreur 400 par IP : " >> ${MAIL} - cat $log_access | awk -F "|" '{ if($2 == "400") print $1}' |sort |uniq -c >> ${MAIL} - echo "--------" >> ${MAIL} - echo "nombre erreur 404 par IP : " >> ${MAIL} - cat $log_access | awk -F "|" '{ if($2 == "404") print $1}' |sort |uniq -c >> ${MAIL} + ERROR=("400" "404") + for j in ${ERROR[@]} + do + echo "nombre erreur ${j} par IP :" >> ${MAIL} + cat $directory_host/${j}_* |sort |uniq -c >> ${MAIL} + echo "----------------" >> ${MAIL} + done cat ${MAIL} |mail -s "Rapport reverse proxy $DATE" valczebackup@gmail.com #rm $directory_host/* done