{
num1=`ps aux |grep $1 |grep -v 'grep'|wc -l` #num=0,$1 is killed
echo $num1
}
echo $num2
}
num3=0
num3=`plive xxserver`
echo $num3
then
echo $date > ./monitor_nn.log
echo "$hostip xxserver already stop" >> ./monitor_nn.log
echo "$hostip xxserver starting..." >> ./monitor_nn.log
nohup /root/code/xxserver &
pid=`getpid nnserver`
if [ $pid -ne 0 ]
then
echo $date >> ./monitor_nn.log
echo "$hostip nnserver already start" >> ./monitor_nn.log
echo "$hostip nnserver24's pid is $pid" >> ./monitor_nn.log
else
echo $date >> ./monitor_nn.log
echo "$hostip nnserver start failed" >> ./monitor_nn.log
fi
done