I searched through the forum and couldn't quite find what I was looking for. I have a script that looks for a process "DW" to be running. If it is not it will email a notice to an account. I would like to add the functionality to have it also email a seperate notice if there is more that one of the "DW" processes running at the same time. The script looks like:
#!/bin/ksh
DATE=$(date +%m%d%y)
TIME=$(date +%H%M)
RECIPIENT=test@mydomain.com
DPID=$(ps -ef | grep dw | grep -v grep)
if [ "${DPID}" = "" ]
then
echo "The data warehouse manager for DB $ORACLE is down at $TIME on $DATE" | mail -s "$ORACLEID DW is down" $RECIPIENT
fi