The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Not able to compile Pro*c file due - give errors and points to /usr/include/.. file shafi2all High Level Programming 0 05-09-2008 03:27 AM
How to track the modification history on file in unix RSPDaemon UNIX for Dummies Questions & Answers 5 03-28-2008 02:39 AM
Keep track of file name completions with Viewglob iBot UNIX and Linux RSS News 0 02-21-2008 05:30 AM
Possible to track FTP user last login? Last and Finger don't track them. LordJezo UNIX for Dummies Questions & Answers 1 11-08-2007 01:21 PM
File I/O ERRORS.. PLS HELP.. SwetaShah High Level Programming 0 09-26-2005 04:44 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-21-2009
sdhn1900 sdhn1900 is offline
Registered User
  
 

Join Date: May 2009
Posts: 5
Question track the errors in log file

OS: SuSE Linux Enterprise Server 10

Goal:
To track the errors in log file, If they exits users will be notify by email.

We have a script below:

Code:
SrchKey="SRVE0242I:"
LogFile=/PATHtemOut.log
MailTo="DN@mail.com
http:// ! -f PATH/alert.last  && touch PATH/alert.last
egrep $SrchKey $LogFile > PATH/alert.new
if http:// -s PATH/alert.new  ;then
diff PATH/alert.new PATH/alert.last > PATH/alert.msg
cp PATH/alert.new PATH/alert.last
http:// -s PATH/alert.msg  &&
mailx -v -s "$SrchKey Alert" $MailTo < PATH/alert.msg
else
echo "Nothing to report, sir." | mailx -s "No Alert Today" ${MailTo}
fi

OUT PUT:

Received email
Subject:SRVE0242I: Alert

Message: "1d0
< Binary file /PATH/log/SystemOut.log matches"

1) We have multiple error messages,
how to add more messages in the script?

2) If one of the message does not exits we should receive message for other existing error code or messages.

thanks
D

Last edited by Franklin52; 05-22-2009 at 06:59 AM.. Reason: adding code tags
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:40 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0