Good morning all. I have a korn shell script that I'd like to write that does the following. It searches on one host for the existence of a process called "tnslsnr trn" and then on another box for the existence of a process called "tnslsnr DEV". I've written the following so far but don't know how to cause it to look for one process on the first host and then another process on the second host without going through alot of lines of code.(The test_hostlist file contains the hostnames of the two machines.
#!/bin/ksh
for HOST in `cat /test_hostlist`
do
dsh -w $HOST ps -ef|grep -v grep|grep "tnslsnr trn"
if [ $? -eq 1 ]
then
echo " The tnslsnr trn process on $HOST is down"
else
echo "The tnslsnr trn process on $HOST is up"
fi
done
Can someone please help. Thanks alot.
#!/bin/ksh
for HOST in `cat /test_hostlist`
do
dsh -w $HOST ps -ef|grep -v grep|grep "tnslsnr trn"
if [ $? -eq 1 ]
then
echo " The tnslsnr trn process on $HOST is down"
else
echo "The tnslsnr trn process on $HOST is up"
fi
done
Can someone please help. Thanks alot.