Help needed with scripting.

Hello Friends,
I am very new to scripting and currently have come across a situation where I need to create a UNIX script which would look for certain text in a file and then email me if it finds it.
I am trying to trouble shoot an issue with our internet websites and I need to know when I get hung threads so that I can run another script to gather more info about them. I want to catch these hung threads before they take down the appserver because then it is too late.

Thanks
Mahive.

What did you code so far?