0

I am planning to write a bash script and run it as a daemon in the background. The script will continuously monitor the tomcat server logs for any exception, error, etc.

When an exception occurs, it will trigger an event and will handle it accordingly (say, by taking java thread dump, etc). I can write the logic on what to do in case of error found in the logs. All I need to know is how to pass information from the daemon to my error handling script.

Could you give me an idea on how to achieve this? Also, any tools which may help me with this task.

Any help will be much appreciated.

1 Answer 1

2

You can do this by using shell script

  tail -Fn0 catalina.txt | \
  while read line ; do
    echo "$line" | grep "pattern"
    if [ $? = 0 ]
    then
           sendemail(
    fi
   done
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .