#!/usr/bin/ksh
# ESOOVAfProc
# Affichage des process OpenView inactifs
#
# Creation:	13/06/95	D.Stoll DRE/12151/ESO
# Modifications :
#
ps -aef | grep ovspmd | grep -v grep > /dev/null
if [ $? = 0 ]
then
	#le process ovspmd tourne, on peut lancer ovstatus
	/opt/OV/bin/ovstatus > /tmp/ovstatus.txt
	grep -n NOT_RUNNING /tmp/ovstatus.txt | cut -d":" -f1 > /tmp/list
	echo "   Process OpenView inactifs"
	echo "   -------------------------\n"
	for i in `cat /tmp/list`
	do
		#recuperation du nom du process
		n=`expr $i - 2`
		cat /tmp/ovstatus.txt | head -$n| tail -1|cut -d":" -f2
		#recuperation de l'exit status
		n=`expr $i + 3`
		cat /tmp/ovstatus.txt | head -$n| tail -1
		echo ""
	done
else
	#OpenView arrte
	echo "OpenView est arrete, aucun process ne tourne."
fi
