ruok #1

  • //
  • guest/
  • yariv_sheizaf/
  • scripts/
  • ruok
  • View
  • Commits
  • Open Download .zip Download (3 KB)
#!/bin/sh

# Check which daemons are up
# Arguments: 
#  1. Globecom Server goal 
# 

rm -f $$.*

if [ $# -lt 1 ]
then
	echo ""
	echo "Usage: $0 server-type [additional-type]"
	echo "Valid types: GINSDA, GINSDU, APPWEB"
	echo "Additional Valid type: ORACLE"
	echo ""
	exit 1
fi

SERVERTYPE=$1
ORACLETEST=$2


if [ "$SERVERTYPE" != "GINSDA" -a "$SERVERTYPE" != "GINSDU" -a "$SERVERTYPE" != "APPWEB" ]
then
	echo ""
	echo $SERVERTYPE" is not a valid type. exit..."
	echo "Valid types: GINSDA, GINSDU, APPWEB"
	echo ""
	exit 1
fi


PROCF=/tmp/procfil$$
ps -ef >$PROCF

for i in Npdd Lsm http java startTrap startIsAli startWeb sdud sdad rmserver oracle
do
	rm -f $$.$i
        grep $i $PROCF > /dev/null
        if [ "$?" = "0" ]
        then
        	touch $$.$i
        fi
done     


        	
## Oracle 
if [ "$2" = "ORACLE" ]
then       
        if [ -f $$.oracle ]
        then
        	echo ""
        	echo "Oracle service is up"
        else
        	echo ""
        	echo "Oracle is not running"
        fi
fi

        	
## GIN with SDA 
if [ "$1" = "GINSDA" ]
then       
        if [ -f $$.sdad -a -f $$.startIsAli -a -f $$.http -a -f $$.Lsm ]
        then
        	echo ""
        	echo "All GINSDA services are up"
        	echo ""
        	exit 0
        else
        	echo ""
        	if [ ! -f $$.sdad ]
        	then
        		echo "sdad is not running"
        	fi	
        	if [ ! -f $$.startIsAli ]
        	then
        		echo "startIsalive is not running"
        	fi	
        	if [ ! -f $$.http ]
        	then
        		echo "Apache is not running"
        	fi	
        	if [ ! -f $$.Lsm ]
        	then
        		echo "Lsm is not running"
        	fi	
        	echo "To restart all services, please run: Globsys.sh -a"
        	echo ""
        	exit 1
        fi
fi

    
## GIN with SDU 
if [ "$1" = "GINSDU" ]
then       
        if [ -f $$.sdud -a -f $$.startTrap -a -f $$.http -a -f $$.Lsm ]
        then
        	echo ""
        	echo "All GINSDU services are up"
        	echo ""
        	exit 0
        else
        	echo ""
        	if [ ! -f $$.sdud ]
        	then
        		echo "sdud is not running"
        	fi	
        	if [ ! -f $$.startTrap ]
        	then
        		echo "startTrapFilter is not running"
        	fi	
        	if [ ! -f $$.http ]
        	then
        		echo "Apache is not running"
        	fi	
        	if [ ! -f $$.Lsm ]
        	then
        		echo "Lsm is not running"
        	fi	
        	echo "To restart all services, please run: Globsys.sh -u"
		echo ""
        	exit 1
        fi
fi

    
## APP + Weblogic 
if [ "$1" = "APPWEB" ]
then       
        if [ -f $$.startWeb -a -f $$.startTrap -a -f $$.http -a -f $$.java ]
        then
        	echo ""
        	echo "All APPWEB services are up"
        	echo ""
        	exit 0
        else
        	echo ""
        	if [ ! -f $$.startWeb ]
        	then
        		echo "Weblogic is not running"
        	fi	
        	if [ ! -f $$.startTrap ]
        	then
        		echo "startTrapFilter is not running"
        	fi	
        	if [ ! -f $$.http ]
        	then
        		echo "Apache is not running"
        	fi	
        	if [ ! -f $$.java ]
        	then
        		echo "Java is not running"
        	fi	
         	echo "To restart all services, please run: Globsys.sh -n"
		echo ""
        	exit 1
        fi
fi
  
rm -f $$.*
                
exit 0                
      
# Change User Description Committed
#1 1472 Yariv Sheizaf scripts dir