Monitor logs for exception and if exception come then sent an email


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Monitor logs for exception and if exception come then sent an email
# 1  
Old 08-15-2013
Computer Monitor logs for exception and if exception come then sent an email

Hi Folks,

please advise , I have logs generated on unix machine at location /ops/opt/aaa/bvg.log , now sometimes there come exception in these logs also, so I want to write such a script such that it should continuously monitor these logs and whenever any exception comes that is it try to find the world exception and when ever any exception comes it should email to the team members , please advise how to proceed Smilie
# 2  
Old 08-15-2013
What code have you tried so far?
# 3  
Old 08-15-2013
And this looks very much like bumping up posts:
https://www.unix.com/unix-dummies-que...namically.html
# 4  
Old 08-16-2013
Code:
grep -i "exception" /ops/opt/aaa/bvg.log | mail -s "Exception occured" email@address.com

You can start from here.
Put in a script, add more logic to it then put it in a cron job to run every minute and you are done!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Searching exception keyword in all logs in last 5 minutes

Hello Folks , I am a new bie to the world of unix , what i am planning to do is the I have the location in server to which i am access through the putty and the location is /mt/ttlog/avccomn/logs/201901/19 and at this location the files are listed as show startjmsnode1.sh_03.out... (7 Replies)
Discussion started by: punpun26262626
7 Replies

2. Shell Programming and Scripting

Catching the exception in multiple logs

Hi folks, I have logs folder in which different type of logs are generated , I am monitoring them by the below command tail -f *.log but I want that if exception come in any of the logs then it should be catch so what i should prefix with tail -f *.log so that it imeediatley catches and... (3 Replies)
Discussion started by: punpun66
3 Replies

3. Shell Programming and Scripting

Line numbers and exception to be caught in logs

Hi Folks, I have just basic queries is that suppose I have to monitor the logs then there is a command , suppose I have to monitor the abc.log which is updating dynamically within seconds so the command will be after going to that directory is .. tail -f abc.log Now please advise what about... (1 Reply)
Discussion started by: punpun66
1 Replies

4. Shell Programming and Scripting

Re: exception using AWK

I have following file: NAME=ora.DG1.svc TYPE=ora.service.type CARDINALITY_ID=1 TARGET=ONLINE STATE=ONLINE NAME=ora.orlene.DG2.svc TYPE=ora.service.type CARDINALITY_ID=1 TARGET=ONLINE STATE=OFFLINE NAME=ora.MN.acfs TYPE=ora.registry.acfs.type TARGET=ONLINE (4 Replies)
Discussion started by: rcc50886
4 Replies

5. Solaris

solaris 7 exception

Hi all, An application works well under 2.6 but under 7 it gives TEXT_IO exceptions. (Is_Open, Check_Is_Open, Get_Line procedures). Any idea? Regards (3 Replies)
Discussion started by: endoavour
3 Replies

6. Programming

Exception Handling C++

Hello All, I have a question ....which I am totally confused about! If I have a fxn foo in a program which returns a logical value. But it has a posssiblity to throw some exception. Now my exception handler returns a value as a string stating why the exception occured. But my... (1 Reply)
Discussion started by: mind@work
1 Replies

7. Shell Programming and Scripting

Exception Handling

Hi, I have written a script to load csv files into a mysql database, however, i would like for the shell script to exit in the event of an error (missing file, load error etc.) - currently if an error is encountered the next statement is processed - This is how i am loading the csv scripts ... (5 Replies)
Discussion started by: bertpereira
5 Replies

8. Shell Programming and Scripting

Perl Exception - $!,$?,$@

Hi, I am trying to understand the significance of the special variables $!,$@ and $? in perl. I have a code block as follows: eval { Code Segment 1: #authenticating to the remote server $ftpobj -> login($username,$password) or die "Can't login to $remote_host"; ... (12 Replies)
Discussion started by: DILEEP410
12 Replies

9. Linux

MMU exception

I hope to post in the right forum, otherwise I apologize for this. if a MMU exception is caused by a process which tries to access to other memory segment (out of its own address space) what the kernel does in this case ? maybe kernel kills the "bad" process ? (2 Replies)
Discussion started by: Puntino
2 Replies

10. UNIX for Advanced & Expert Users

exception handling

Does exception handling exist in any UNIX enviornment? I develop on Windows MSVC++ land and need to port to UNIX. (1 Reply)
Discussion started by: RichardS
1 Replies
Login or Register to Ask a Question