I need to monitor hanging processes on the output of ps -ef | grem GMC
…
What's the best way to do this without running this command manually and being stuck in front of a command line all day? I'd like to our dev team to get an email whenever one of these processes hangs so we can investigate, or better yet, auto-killing dying processes.
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 1
LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64"
Novell Open Enterprise Server 2 (x86_64)
VERSION = 2
BUILD = FCS
Best Answer
A simple script like the one following does the magic:
Then run this every 5 minutes from your
crontab
.You might also want to check tools like daemontools or monit. Both these tools are open source utilities that check processes and restart them if they're not running.
Hope this helps!