Search for string and send mail


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Search for string and send mail
# 1  
Old 03-05-2009
Search for string and send mail

Hi,
I need to find if there is any error in the last few lines of the log file and send a mail accordingly.For example,
Following errors can be logged in the log file.
ERR_1="DB Connection not established"
ERR_2="Server Unloading"
I need to find if these errors are found in the log file and send different mails according to the errors.
How can we do that?
# 2  
Old 03-05-2009
Hi,

Below one can help you..

https://www.unix.com/shell-programmin...ance-grep.html

Thanks
Sha
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

2. Shell Programming and Scripting

Search the string in the active log and send mail

Hello, I wanted to search specific string in the acitve log file and send an email if the search string found in the log. Log file is written by application all the time. So, script has to search if any new log entry has the specific string for example " sample exception" and send an email. (1 Reply)
Discussion started by: balareddy
1 Replies

3. Ubuntu

Not able to send mail out of UbuntuBox in send mail

Hi Guys.. yesterday i purchased a VPS server and installed sendmail on ubuntu 12.4 with Webmin & Apache runing webserver problem is.. i can send mail via webmin user interface account to anybody to out side to any domain and able to recieve any mail from any domain.. Now main... (2 Replies)
Discussion started by: cmdman
2 Replies

4. UNIX for Dummies Questions & Answers

Search string and send email

Hi All, I need script which should search for the "reason code" and it should send mail with its preceding line as well as the line below it.(first line before it and line after it) I used below script but it is printing the whole lines inside it, your help is appreciated: cd... (3 Replies)
Discussion started by: rockingvj
3 Replies

5. Shell Programming and Scripting

Search a string and send the line containing it

Folks, Need a script which searches for a string and send line containing the string to the mail. The requirement is like this : file abc.log containts below text : "error occurred due to the code 3456 and kill the process to recover it" 1. search for string "3456" and send entire... (14 Replies)
Discussion started by: rockingvj
14 Replies

6. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

7. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

8. Shell Programming and Scripting

search a string and mail it as attachment

Hi All, I need to search a text in a string, assign it to a variable. Ex : I need to get the number that has gif extension. The number is not constant. The search value should return as 1174499845 from the following string. x 1174499845.gif, 133982 bytes, 262 tape blocks Go to... (3 Replies)
Discussion started by: jagadeeshtata
3 Replies

9. Shell Programming and Scripting

send mail once string is seen

I need to write a script that when it sees the following string in a log file, it emails a group of people SQLException: ORA-12157: TNS:internal network communication error im a newb to scripting, any ideas would be appreciated (14 Replies)
Discussion started by: csaunders
14 Replies

10. UNIX for Dummies Questions & Answers

can not send mail from unix server to company/yahoo mail

hi, Gurus, I need some help with sending mail out from my UNIX server: It is running Solaris 2.6 and the sendmail version is 8.8. Output of :/usr/lib/sendmail -d0.1 -bt < /dev/null Version 8.8.8+Sun Compiled with: LOG MATCHGECOS MIME7TO8 MIME8TO7 NAMED_BIND NDBM NETINET ... (5 Replies)
Discussion started by: b5fnpct
5 Replies
Login or Register to Ask a Question