Tomcat Monitoring log file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Tomcat Monitoring log file
# 1  
Old 08-09-2012
Monitoring log file

Hi,

I ned to monitor the tomcat log file called "catalina.out" for "OutOfMemory" ,"java.sql.SQLException" and "Error" error.

the script should monitor this file (catalina.out) and send us the mail as soon as it finds the string "Out of memory" or "java.sql.SQLException" or "Error" in the file.

can anyone suggest me which is the best way to do this?

Thanks in advance

Last edited by mnmonu; 08-09-2012 at 07:56 AM..
# 2  
Old 08-09-2012
There are several log monitoring options available on the internet and sadly, most of them require some type of work. Your log monitoring endeavor can be significantly simplified if the log file you wish to monitor actually has date and timestamps in it...meaning, do the lines in the log contain some type of date and time?

if so, then,

1. you can either write your own log monitoring script: this would take a lot of time and can be very messy. There are several scenarios to consider to ensure you are actually informed when the state of the log file and its contents changes or matches your specified criteria.

2. you can grab programs off the internet that will attempt to monitor the log for you. the drawback to this (in my opinion) is that most of these programs require the installation of other applications or they require too much time to get accustom to. but if you need their names, here they are: swatch, splunk.

3. i have nagios installed in my environment and i use a tool called logrobot. you can do a search for logrobot and see if that fits your need. as far as i know, it doesn't send emails..except only via Nagios. but i guess it can be configured to do so via cron if thats what you needed.

if you dont have timestamps in your log file, things can get very messy and i would leave this to other members of this forum to provide their suggestions for this type of situation.

If you have Nagios, you may want to read this article:

http://ezinearticles.com/?Nagios-Log...ely&id=5862227

Last edited by SkySmart; 10-10-2012 at 09:59 AM.. Reason: Found a more detailed article
# 3  
Old 08-09-2012
write one script to check your predefined errors...

it won't take much efforts....Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell script for continuously monitoring log file

Hi I have written below log monitoring script to egrep multiple words and redirect the output to a text file and its working fine but I want to add some more below given functionality to it, which is very advance and im not very good in it, so please help if you can :) I am egrepping all the... (1 Reply)
Discussion started by: scazed
1 Replies

2. UNIX for Beginners Questions & Answers

Monitoring script for Log file

Hi, Iam new to unix , plz help me to write below script. I need to write a script for Monitoring log file when any error occurs it has to send a mail to specified users and it should be always pick latest error not the existing one and the script should be able to send mail all errors (more... (1 Reply)
Discussion started by: vij05
1 Replies

3. UNIX for Advanced & Expert Users

Alternative to tail -n -0 -F for monitoring live log file

Hello, I have been working on script which need to generate an alert based upon live logs. If string is found then an alert mail must triggered. tail -n -0 -F works fine to redirect the each latest line from live logs file to grep a pattern for matching but it seems to be not working on... (7 Replies)
Discussion started by: ketanraut
7 Replies

4. Shell Programming and Scripting

Monitoring script for a log file

Hi, I need to get a script working to monitor a log file and throw an alert via mailx as soon as a particular error is encountered. I do not want repeatative email notifications of same error so simply cat logfile and grepping the error would not work. Here is what i planned but it seems... (2 Replies)
Discussion started by: roshan.171188
2 Replies

5. Shell Programming and Scripting

Monitoring Tomcat Service with shell script

Hello Forum, I have prepared script to monitor the tomcat status. Following is the script which will monitor tomcat instance. I need little modifcation in the script. My script will grep for process, the output of grep command will analyze by if condition under for loop and will send... (2 Replies)
Discussion started by: ooilinlove
2 Replies

6. Solaris

Tomcat..Unable to deploy application remotely in tomcat

Hi, We have upgrade tomcat from 5.0.20 to 7.0.33 and made changes to server.xml file according to newer version.. how ever the upgrade went fine and now i am unable to deploy application remotely.. it is giving 403 access denied error.. we have seperate appbase directory mentioned in server.xml..... (0 Replies)
Discussion started by: phani4u
0 Replies

7. Shell Programming and Scripting

Tomcat log file in date format

Hi, I was asked to write a new logrotate file for tomcat logs..in which one of the requirement is to have date and time appended at the end of the file name. I have tried dateext and dateformat-%Y-%m-%d-%s but these directives didn't have the option for HH:MM. I am very new to this... (2 Replies)
Discussion started by: sdspawankumar
2 Replies

8. Shell Programming and Scripting

help needed - log file monitoring script

hi Gurus, Need to pick your brains on this minor script project. I would like to continuously monitor a log file with sample log messages as below, and if PSOldGen percentage is either 99% or 100% for consecutively 10 times, alert someone. {Heap before gc invocations=46516: PSYoungGen ... (6 Replies)
Discussion started by: kenchen722
6 Replies

9. Shell Programming and Scripting

Monitoring Tomcat Instance using shell script

Hello Forum, I have prepared script to monitor the tomcat status. Following is the script which will monitor tomcat instance.I need little modifcation in the script. My script will grep for java,the output of grep command will analyze by if condition under for loop and will send following echo... (7 Replies)
Discussion started by: coolguyamy
7 Replies

10. Shell Programming and Scripting

Monitoring log file

Hi, I ned to monitor the tomcat log file called "catalina.out" for "Out of memory" error. the script should monitor this file and send us the mail as soon as it finds the string "Out of memory" in the file. can ypu suggest me which is the best way to do this? (4 Replies)
Discussion started by: shivanete
4 Replies
Login or Register to Ask a Question