12-07-2010
Hello Jim,
Thanks for the response. The script is working fine for me after little modifcation.
h1=`hostname`
#d1=`date +%D::::%T`
d1=`date`
tomcat1logs=/opt/local/tomcat1
tomcat2logs=/opt/local/tomcat2
tomcat3logs=/opt/local/tomcat3
tomcat4logs=/opt/local/tomcat4
tomcat5logs=/opt/local/tomcat5
tomcat6logs=/opt/local/tomcat6
for fname in $tomcat1logs $tomcat2logs $tomcat3logs $tomcat4logs $tomcat5logs $tomcat6logs
do
tom=$(basename $fname)
f=${fname}/logs/catalina.out
var=`tail -10 $f | grep -i outofmemory | sed -n '$p' | sed -n -e "s/.*\(OutOfMemoryError\).*/\1/p"`
if [ ! -z "$var" ] ;
then
echo "$var error on $tom on server $h1 @ $d1" | mailx -s "$var error in $tom" $sms_list
else
echo "No OutofMemory on $tom on server $h1 @ $d1" >>/opt/app/mxora/home/mxora/outofmemory.txt
fi
done
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm about 5 months new on an 5 year old unix system. If anyone can help me identify what causing the below errors i'd really appreciate it!
unix: WARNING: /pci@1f,0/pci@1,1/ide@3/dad@1,0 (dad1):
Uncorrectable data Error: Block 57e10
Unix: WARNING: /pci@1f,0/pci@1,1/ide@3/dad@1,0 (dad1):... (1 Reply)
Discussion started by: ByasB
1 Replies
2. UNIX for Advanced & Expert Users
I am getting this message in the log file.
Apr 29 15:32:02 router ppp: Warning: Label COPYRIGHT rejected -direct connection: Configuration label not found
This repeats every so often, the link is up however...Any ideas why i am getting this. Its freebsd 6.1 and pppoE.
Frank (1 Reply)
Discussion started by: frankkahle
1 Replies
3. Shell Programming and Scripting
Hi,
We use an application that is dumping logs to a file on disk. However, this is dumping very verbosely and there is no method of turning down the logging level. We need to remove certain contents from these before they are commited to disk.
Has anybody got any ideas how I can do this... (3 Replies)
Discussion started by: harperonline
3 Replies
4. Shell Programming and Scripting
Hi,
I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows:
""""""""""""""""""""""""""... (3 Replies)
Discussion started by: harish.parker
3 Replies
5. Shell Programming and Scripting
(I'm aware log rotation is a common subject, but I tried searching and couldn't find an answer)
For some time now, I've been using the Logfile::Rotate module to rotate logs in a log-monitoring script. So far, I haven't experienced any problems, and it works great because I can use it in Linux... (1 Reply)
Discussion started by: w1r3d
1 Replies
6. Shell Programming and Scripting
I have requirement to prepare script which will grep for latest outofmemory message from the logs. I have used following command to grep the string from the logs,this script is not effective when logs are not getting updated as it will grep for old message.
f=catalina.out
var=`tail -10 $f |... (17 Replies)
Discussion started by: coolguyamy
17 Replies
7. Shell Programming and Scripting
Hello Team,
I need help to improve my script which is used to grep 500 error messages in the logs.
I am using following logic in the script to grep 500 error messages in the logs.
var1=`awk '$9 == "500"' access_log | tail -1`
The above logic is not useful if logs are not getting... (1 Reply)
Discussion started by: coolguyamy
1 Replies
8. Shell Programming and Scripting
Hi all,
. I am developing a log monitoring solution in perl for Windows I am using the CPAN module Win32 ::EventLog (0.076) version for getting the events from windows. The problem which I am facing now is all the Windows 2008 machines are upgraded with Service pack2 from then I couldn’t able... (2 Replies)
Discussion started by: kar_333
2 Replies
9. Shell Programming and Scripting
Hi Guys,
I want to write a script which can grep the logs (server.log) from a file for Error String and output to a other file.
Problems:
How to know about the errors only between the current restart and not in previous as server.log has earlier restarts also?
thanks for the help! Much... (5 Replies)
Discussion started by: ankur328
5 Replies
10. Shell Programming and Scripting
Appreciate help for the below issue.
Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt..............
1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies
LEARN ABOUT DEBIAN
hobbitd_filestore
HOBBITD_FILESTORE(8) System Manager's Manual HOBBITD_FILESTORE(8)
NAME
hobbitd_filestore - hobbitd worker module for storing Xymon data
SYNOPSIS
hobbitd_channel --channel=status hobbitd_filestore --status [options]
hobbitd_channel --channel=data hobbitd_filestore --data [options]
hobbitd_channel --channel=notes hobbitd_filestore --notes [options]
hobbitd_channel --channel=enadis hobbitd_filestore --enadis [options]
DESCRIPTION
hobbitd_filestore is a worker module for hobbitd, and as such it is normally run via the hobbitd_channel(8) program. It receives hobbitd
messages from a hobbitd channel via stdin, and stores these in the filesystem in a manner that is compatible with the Big Brother daemon,
bbd.
This program can be started multiple times, if you want to store messages for more than one channel.
OPTIONS
--status
Incoming messages are "status" messages, they will be stored in the $BBLOGS/ directory. If you are using xymon(7) throughout your
Xymon server, you will not need to run this module to save status messages, unless you have a third-party add-on that reads the sta-
tus-logs directly. This module is NOT needed to get trend graphs, you should run the hobbitd_rrd(8) module instead.
--data Incoming messages are "data" messages, they will be stored in the $BBDATA directory. This module is not needed, unless you have a
third-party module that processes the data-files. This module is NOT needed to get trend graphs, you should run the hobbitd_rrd(8)
module instead.
--notes
Incoming messages are "notes" messages, they will be stored in the $BBNOTES directory. This modules is only needed if you want to
allow people to remotely update the notes-files available on the Xymon webpages.
--enadis
Incoming messages are enable/disable messages, they will update files in the $BBDISABLED directory. This is only needed if you have
third-party add-ons that use these files.
--dir=DIRECTORY
Overrides the default output directory.
--html Used together with "--status". Tells hobbitd_filestore to also save an HTML version of the status-log. Should not be used unless you
must run with "BBLOGSTATUS=static".
--htmldir=DIRECTORY
The directory where HTML-versions of the status logs are stored. Default: $BBHTML
--htmlext=.EXT
Set the filename extension for generated HTML files. By default, HTML files are saved with a ".html" extension.
--multigraphs=TEST1[,TEST2]
This causes hobbitd_filestore to generate HTML status pages with links to service graphs that are split up into multiple images,
with at most 5 graphs per image. If not specified, only the "disk" status is split up this way.
--only=test[,test,test]
Save status messages only for the listed set of tests. This can be useful if you have an external script that needs to parse some of
the status logs, but you do not want to save all status logs.
--debug
Enable debugging output.
FILES
This module does not rely on any configuration files.
SEE ALSO
hobbitd_channel(8), hobbitd_rrd(8), hobbitd(8), xymon(7)
Xymon Version 4.2.3: 4 Feb 2009 HOBBITD_FILESTORE(8)