To exclude a string from monitoring


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting To exclude a string from monitoring
# 8  
Old 03-06-2013
Hi,

Thanks for your reply
Linux platform
Is there any other way of getting there ?

Last edited by ajothi; 03-06-2013 at 05:55 PM..
# 9  
Old 03-06-2013
Quote:
Originally Posted by ajothi
Hi,

Thanks for your reply
Linux platform
Thanks for sharing!
Issue resolved I assume?
# 10  
Old 03-06-2013
Quote:
Originally Posted by ajothi
Hi Thanks again, I tested the script however its not working as expected Smilie
There was an ERROR string apart from the "Error while reading from socket" and the script was not able to catch that error and send email
Show more of your input please, including the error it failed to catch.
# 11  
Old 03-07-2013
Hi issue is not resolved yet!

The error its not catching is below

Code:
[dbupdate] ERROR  - ReaderException while receiving directives :
com.workbrain.clocks.server.wbsynch.CommunicationException: ; nested exception is:

Moderator's Comments:
Mod Comment
Please use code tags when posting data and code samples!


---------- Post updated 03-07-13 at 09:19 AM ---------- Previous update was 03-06-13 at 06:21 PM ----------

Hi All,

Could some one please help me to fix this issue? thanks in advance

---------- Post updated at 09:53 AM ---------- Previous update was at 09:19 AM ----------

Hi,

The script also failed because it actually catches the exception
"Error while reading from socket"

Basically I want to ignore this error "Error while reading from socket" and the script should alert me for any other errors apart from this

---------- Post updated at 10:42 AM ---------- Previous update was at 09:53 AM ----------

Moving the thread to top

Last edited by ajothi; 03-07-2013 at 11:18 AM.. Reason: code tags, please!
# 12  
Old 03-07-2013
Do not bump posts.

Do not double post.

If we do not reply to your thread immediately, wait! We are not 'on call'.

vgersh's solution was working backwards I think, and had an unneeded 'exit' which stopped it from working -- otherwise his idea is sound:

Code:
logfile="/tmp/application.log"
if awk '/ERROR/ && !/Error while reading from socket/ { _e=1 } END { exit !_e}' $logfile
         echo "found- send email"
else
         echo "not found"
fi

This User Gave Thanks to Corona688 For This Post:
# 13  
Old 03-07-2013
Sorry about that, perfectly worked!!! thanks so much again!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Du exclude in Solaris

How do you exclude a filesystem using du command in solaris? for example /proc Tried this but its not working du -sk -d /* --exclude=/proc | sort -nr | cut -f2 | xargs du -sh | head - (1 Reply)
Discussion started by: jinslick25
1 Replies

2. UNIX for Dummies Questions & Answers

Du exclude in Solaris

How do you exclude a filesystem using du command in solaris? for example /proc Tried this but its not working du -sk -d /* --exclude=/proc | sort -nr | cut -f2 | xargs du -sh | head - in linux it is working. (2 Replies)
Discussion started by: jinslick25
2 Replies

3. Shell Programming and Scripting

Exclude string

I would like to write a script to check the log , if any line in the log have the string in include_list.txt but do not have the string in exclude_list.txt , then send alert mail to administrator , as below example , the line 1 have the string "string 4" ( which is in include_list.txt ) but do not... (7 Replies)
Discussion started by: ust3
7 Replies

4. Shell Programming and Scripting

Exclude files in ls

Hi, I need to exlucde the files which are present in exclude.txt from a directory exlcude.txt AUZ.txt AUZ.chk NZ.txt NZ.chk tried with below code but not working ls -ltr | grep -v `cat exclude.lst` (9 Replies)
Discussion started by: rohit_shinez
9 Replies

5. Shell Programming and Scripting

Little help with rsync --exclude

Loving the rsync command and beginning to write some scripts with it. However I'm hung up on the --exclude function. Script is tested and works great BEFORE I put the --omit in. What am I doing wrong in my syntax? rsync $OPTS /cis/cloverleaf/cis6.0/integrator/... (2 Replies)
Discussion started by: B_ROX
2 Replies

6. Shell Programming and Scripting

Exclude a file or not in

Hi Gurus. I have a directory and i receive many files with extension .log. I processed the file as i get it. i want to process all the files except one which i know i don't want to process. cd /backup/temp/rajesh/PACS #--- directory , under this i have below files... (1 Reply)
Discussion started by: guddu_12
1 Replies

7. Ubuntu

[Solved] Using Find with an exclude/exclude file

I am familiar with using tar and exclude/include files: tar zcf backup.dirs.tgz --files-from=include.mydirs --exclude-from=exclude.mydirs --no-recursion but was wondering if I could use find in the same way. I know that you can just specify the directories to exclude but my list is... (2 Replies)
Discussion started by: metallica1973
2 Replies

8. Shell Programming and Scripting

Monitoring specific string or keyword in rotating log files.

Hi there, I like to ask how i shall monitor specific string or keyword in rotating log files. e.g. I have at 10 rotating logfiles. I use the command below to grep the string, but eventually become non functional because the logfile rotates and new logfile is active. tail -f <logfile1> |grep... (1 Reply)
Discussion started by: shtobias
1 Replies

9. Shell Programming and Scripting

ls to exclude file

I have cgicsave.env and cgic*, but I want to print cgic* value but NOT cgicsave.env Thanks (9 Replies)
Discussion started by: xs2punit
9 Replies

10. UNIX for Dummies Questions & Answers

Getting 'tar' to exclude

I want 'tar' to exclude certain dir's. tar cvf ............. ............ does the whole lot, but I want to exclude the 'log' dirs. (6 Replies)
Discussion started by: kuultak
6 Replies
Login or Register to Ask a Question