# In DEBUG mode: generate some files under "/tmp" to see, the script is running
if [ "$DBG" = "dbg" ]
then
mkdir -p /tmp/Fujitsu/
tail $SCRIPTLOG 2>/dev/null > $SCRIPTLOG.bk
mv -f $SCRIPTLOG.bk $SCRIPTLOG
echo "$0 V__MP_VERSION__ last ran at `date`" >> $SCRIPTLOG
fi
# test that ServerView Linux Agents (srvmagt) are installed
SRVMAGT=`whereis srvmagt | awk 'NF>1{print $2}'`
if [ "$SRVMAGT" = "" ]
then
echo "ServerView Linux Agents are *NOT* installed! Cannot recover."
exit 0
fi
[ "$DBG" = "dbg" ] && echo "ServerView Linux Agents are installed at: $SRVMAGT"
# test that eecd is installed
EECD=`whereis eecd | awk 'NF>1{print $2}'`
if [ "$EECD" = "" ]
then
echo "ServerView Linux Agents EECD is *NOT* installed! Cannot recover."
exit 0
fi
[ "$DBG" = "dbg" ] && echo "ServerView Linux Agents EECD is installed at: $EECD"
# test that EECD is running
EECDRUNNING=`ps -A | grep -i '[e]ecd'`
if [ "$EECDRUNNING" = "" ]
then
echo "ServerView Linux Agents EECD is not running, starting"
srvmagt start
exit 0
fi
[ "$DBG" = "dbg" ] && echo "ServerView Linux Agents EECD is running"
# test if EECD is listening
EECDLISTENING=`netstat -nlx | grep -i "/dev/eecds\|/dev/eecda" | wc -l`
if [ $EECDLISTENING -lt 2 ]
then
echo "ServerView Linux Agents EECD is not listening, restarting"
srvmagt restart
exit 0
fi
[ "$DBG" = "dbg" ] && echo "ServerView Linux Agents EECD is listening"
[ "$DBG" = "dbg" ] && echo "Nothing to do"