This is the second, fully automated remediation form of the Zombie script. This one, unlike the other, can and WILL take action. Let me repeat. THIS WILL KILL PROCESSES ON YOUR SERVERS!
Let me summarize what this will do.
1. Check for Zombie processes running, grabbing their state, process id (pid) and parent id (ppid).
2. Run kill -9 (end process) on every associated ppid that is currently a zombie process.
3. Wait 10 seconds (choose whatever you want, I did sleep 10)
4. Output if any zombie processes REMAIN.
So what this will do then, is try to fix the problem and report back the number of zombies that missed the first purge. As some zombie movies may tell you, always double tap. Keep in mind that if zombie processes don't die after 10 seconds (they should), then you might have some problems. Or maybe it'll pick it up on the second attempt. That's all up to you, dear user.
Some people like to dip their toes in the ocean. Some people like to skydive. Some people juggle with chainsaws. This, fellow thwacksters, might be trending a bit towards the latter. This is a little bit like playing with hand grenades - not something I have experience with, so this is figuratively speaking.
For those of you who only want to dip their toes in the water, Zombie process count - 'Nix - Application Monitor Templates - Server & Application Monitor - THWACK is the original form of this script, which strictly looks for zombies.