aboutsummaryrefslogtreecommitdiff
path: root/tools/diag
diff options
context:
space:
mode:
authorWolfram Schneider <wosch@FreeBSD.org>1998-02-15 18:54:26 +0000
committerWolfram Schneider <wosch@FreeBSD.org>1998-02-15 18:54:26 +0000
commit40d75fab43785788b229ea0e98ff17a71ea8525e (patch)
tree2e0facd1ee913e87d549a020fb31a51be70affcd /tools/diag
parentae7458879976e22f663f7f8f7ab73ead7de736a1 (diff)
downloadsrc-40d75fab43785788b229ea0e98ff17a71ea8525e.tar.gz
src-40d75fab43785788b229ea0e98ff17a71ea8525e.zip
httpd-error is a shell script which print a summary about
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.
Notes
Notes: svn path=/head/; revision=33410
Diffstat (limited to 'tools/diag')
-rw-r--r--tools/diag/README1
-rwxr-xr-xtools/diag/httpd-error/httpd-error40
2 files changed, 41 insertions, 0 deletions
diff --git a/tools/diag/README b/tools/diag/README
index 18f7b684eb5b..fb70f02a22b3 100644
--- a/tools/diag/README
+++ b/tools/diag/README
@@ -7,3 +7,4 @@ the integrity.
Please make a subdir per program, and add a brief description to this file.
ac check if the FreeBSD handbook is in sync with the committers list
+httpd-error check for Web files which does not exists on your host
diff --git a/tools/diag/httpd-error/httpd-error b/tools/diag/httpd-error/httpd-error
new file mode 100755
index 000000000000..b1ff405321c0
--- /dev/null
+++ b/tools/diag/httpd-error/httpd-error
@@ -0,0 +1,40 @@
+#!/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
+
+