![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Federated Event Systems: The Event Web | iBot | Complex Event Processing RSS News | 0 | 05-16-2008 12:50 AM |
| Simple Event Processing != Complex Event Processing | iBot | Complex Event Processing RSS News | 0 | 12-16-2007 09:10 AM |
| Event Streams and Event Clouds Revisited | iBot | Complex Event Processing RSS News | 0 | 08-09-2007 08:50 PM |
| automated ftp. | sangfroid | Shell Programming and Scripting | 10 | 05-07-2007 08:52 AM |
| Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win) | Vetrivela | UNIX for Advanced & Expert Users | 2 | 02-15-2005 07:43 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
automated email on a log event
I am monitoring a logfile using tail -f file.log|"ERROR"
I would like to write a korn script that monitors this for me and emails me if the event happens. It would be great if it attached the file to the email as well. Any Ideas? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
while true
do
tail -f file.log | grep -q 'ERROR'
if [ $? -eq 0 ] ; then
cat file.log | /usr/bin/mailx -s 'logfile error' me@whereIam.com
break
fi
done
when to exit the loop. |
|
#3
|
||||
|
||||
|
What about this: http://www.unix.com/showthread.php?p...#post302073804
|
||||
| Google The UNIX and Linux Forums |