Scripting an alarm

Hi All,
I am monitoring batch Processes running in UNIX environment.
I use PuTTy to monitor the process running.
I have to continuously monitor and look on the screen if some error has come or not.

If an error comes FAILURE word is displayed instead of SUCCESS as shown below on the screenshot.
I want to write a code such that if the word FAILURE appears on the PuTTy screen
a sound alarm may be raised or so.

Please see the attachment.

Kindly help me.

redirect the output to grep, if there is a match - let it show an alert.

echo "failure" | grep 'failure' && notify-send "there is a failure"

echo "success" | grep 'failure' && notify-send "there is a failure"

If you dont have notify-send, use some other alerting mechanism in your OS.

But the Processes are running on PuTTy which is a Windows XP Software.
Where should I write this code which u have given and how to implement that?