Operating System - Tru64 Unix
1827827 Members
2074 Online
109969 Solutions
New Discussion

Have any shell script for process monitor?

 
sonix
Occasional Contributor

Have any shell script for process monitor?

Have any sample for tru64 process monitor shell script ??
1 REPLY 1
Ivan Ferreira
Honored Contributor

Re: Have any shell script for process monitor?

This is a very simple script that I use to monitor a process called collect. It runs by cron, you can configure the frecuency to run the script. Modify the script to match your process and needs.

COLLECT_RUNNING=`ps auxwww |grep "[c]ollect -i" |wc -l`

if [ "$COLLECT_RUNNING" -gt 0 ]; then
# echo "collect is running"
exit 0
else
echo "collect is not running, starting collect"
/sbin/init.d/collect start
fi
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?