Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
|
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 23rd, 2010, 03:51 AM
Registered User
 
Join Date: Feb 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Counting the HTTP 500 error per minute

Hi

I am trying to write a script to count and record the number of http 500 errors per minute upon parsing the httpd.conf ,

I have written 2 scripts for this :
1.
# Script to catch Http 500 Errors in a separate file

tail -500 access_log |awk '$9 == 500 {print $9}' >>/tmp/500.log

2.

# Script to Monitor for Http 500 Error Build up

Conn_Threshold=50 #Set Threshold value
count=`wc -l /tmp/500.log` #Count the NUmber of 500s
val=`grep -c 500 /tmp/500.log` #Assign the value to a variable
echo $val

#If threshold value exceeds the limit then page the Analyst
if [ "${val}" -ge "${Conn_Threshold}" ];

then echo "The Http 500 Counted exceeded 50 , please check the logs"
echo '' >500.log #Reset the Counter
fi

This doesnt seem to work as I am not able to capture the number of http 500's for the last one minute. any help here would be great.

Praveen.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Http 500 using jsp nubileras Apache Tomcat 1 July 27th, 2008 11:35 PM
HTTP/1.1 500 Internal Server Error Dmitriy General .NET 0 February 26th, 2008 04:50 PM
asp error http 500 davidclangley ASP.NET 2.0 Basics 1 February 14th, 2007 06:18 AM
HTTP 500 error pjdas JSP Basics 0 November 21st, 2003 02:13 PM
HTTP 500 Internal Server Error hosefo81 Beginning PHP 3 October 22nd, 2003 08:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.