40d75fab43
Web files which does not exists on your host. E.g. httpd-error -userhits < /var/log/httpd-error.log print the number of errors by users, sorted by error hits.
41 lines
871 B
Bash
Executable File
41 lines
871 B
Bash
Executable File
#!/bin/sh
|
|
# Copyright (c) 1998 by Wolfram Schneider <wosch@FreeBSD.org>, Berlin.
|
|
# <insert BSD Licence>
|
|
#
|
|
# httpd-error - check for Web files which does not exists on your host
|
|
#
|
|
# $Id$
|
|
|
|
mode=${1}
|
|
|
|
case "$mode" in
|
|
-host)
|
|
grep 'File does not exist$' |
|
|
awk '{print $11}' |
|
|
sort | uniq -c | sort -nr | perl -npe 's/,$//'
|
|
;;
|
|
-filehits)
|
|
grep 'File does not exist$' |
|
|
awk '{print $8}' |
|
|
sort | uniq -c | sort -nr
|
|
;;
|
|
-user)
|
|
grep 'File does not exist$' |
|
|
awk '{print $8}' |
|
|
sort | uniq -c | sort +1
|
|
;;
|
|
-userhits)
|
|
grep 'File does not exist$' |
|
|
awk '{print $8}' | sort |
|
|
perl -npe 's#/home/([^/]+)/public_html.*#/~$1/#;
|
|
s#/usr/local/www/data/.*#/usr/local/www/data/#' |
|
|
uniq -c | sort -nr
|
|
;;
|
|
|
|
*) echo 'usage $0 {-host|-filehits|-user|-userhits} < error.log' >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
|