Solved

This is in RHEL 5.0 and AIX 5.3..Need a script

Posted on 2011-09-21
3
427 Views
Last Modified: 2012-05-12
This is in RHEL 5.0 and AIX 5.3..Need a script

I have a file in the location /home/ktabcd12/system.out.log

the system out.log gets appended as and we navigate the application

I need a scipt to look at Systemout.log every 15 mins and grep for
 
grep "** trying to find files for: ** took **" SystemOut.log >a.txt

cat a.txt

[9/21/11 17:23:24:130 GMT] 00000077 SystemOut     O com.app.doc.project.look.app.appInterface: trying to find files for: 403726 took 4893ms

[9/21/11 17:31:24:130 GMT] 00000077 SystemOut     O com.app.doc.project.look.app.appInterface: trying to find files for: 403726 took 5293ms

and from the file I need to look at  *ms and if the ms exceeds more than 10000 i.e if trying to find files for: 403726 took 10000ms or more

 ..I need to send an email saying an alert that  it is taking more tham 10000ms
0
Comment
Question by:aixtutorial
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:aixtutorial
ID: 36575565
please provide a shell script for this
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 36575704

#!/bin/bash

SYSTEM_OUT_FILE=/home/ktabcd12/system.out.log

grep 'trying to find files for:' $SYSTEM_OUT_FILE | awk '{print $(NF-2),$NF}' | sed 's/ms//g' | while read  FILE  TIME
do
  if [ $TIME -gt 10000 ]; then
    echo "File $file took more than 10000ms" | mail -s "$FILE slow"  <your email addres>
  fi
done

Open in new window

0
 
LVL 38

Accepted Solution

by:
wesly_chen earned 500 total points
ID: 36575715
Woo, type, lien 8 change to
echo "File $FILE took more than 10000ms" | mail -s "$FILE slow"  <your email addres>
#!/bin/bash

SYSTEM_OUT_FILE=/home/ktabcd12/system.out.log

grep 'trying to find files for:' $SYSTEM_OUT_FILE | awk '{print $(NF-2),$NF}' | sed 's/ms//g' | while read  FILE  TIME
do
  if [ $TIME -gt 10000 ]; then
    echo "File $FILE took more than 10000ms" | mail -s "$FILE slow"  <your email addres>
  fi
done

Open in new window

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question