Shell Script to grep a specific error from log file and send email alert

Hi,

I am new to shell scripting and I am facing a challenge. I need a shell script to find a specific error in log file and send email alert automatically. Below are the details.

  1. I am using WinSCP to view the log files.
  2. I need to find 'out of memory' error from an application log file. The path will be /app/hard_coder/logs/Sys01/application.log
  3. The script will run for every 4 hours using cron tab and check the error for the last 4 hours.
  4. If out of memory error is found, it should send an alert saying 'out of memory error found' to 'example@abc.com' . If there are no errors it should send an alert saying ;'everything is fine'.

Reply tab is open for your suggestions.

Thanks !!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.