Apache

Port 80 check

netstat -tn 2>/dev/null|grep ':80[[:space:]]'|awk '{print $5}'|cut -f1 -d:|sort|uniq -c|sort -rn|head

Errors in a provided window apache error logs

/usr/local/apache/logs/error_log

 (echo; read -p "Start time (Jan 01 00:00): " stime; read -p "End time (Jan 01 00:00): " etime; echo -e "\n\n"; awk -v s="$stime" -v e="$etime" '/'"$s"'/,/'"$e"'/' /usr/local/apache/logs/error_log)

Errors in a provided window for php-fpm error-logs

/home/*/logs/*.error.log

(echo; read -p "Start time (01-Jan-2019 00:00:00): " stime; read -p "End time (Jan 01 00:00): " etime; echo -e "\n\n"; awk -v s="$stime" -v e="$etime" '/'"$s"'/,/'"$e"'/' /home/*/logs/*.error.log)

Most requests in last 60 minutes

/home/*/access-logs/

(for d in $(find /home/*/access-logs/ -type f); do echo -e "$(awk -v minTime=$(date -d '60 min ago' '+%Y%m%d%H%M%S') '{split($4,t,/[[ :\/]/); mthNr = sprintf("%02d",(index("JanFebMarAprMayJunJulAugSepOctNovDec",t[3])+2)/3); curTime = t[4] mthNr t[2] t[5] t[6] t[7]} curTime >= minTime ' $d | wc -l) \t$d" ; done;) | sort -nr | egrep -v "^0 "