agent_check.sh
#!/bin/bash
agent_status=`ps -ef | grep -i gcagent.tmmain.TMMain|grep -i sysman |grep -v grep | wc -l`
if [ $agent_status = 0 ]
then
date >> /u01/app/agent13c/log/agentStarted.log
/u01/app/agent13c/agent_13.4.0.0.0/bin/emctl start agent >> /u01/app/agent13c/log/agentStarted.log & > /dev/null
#mailing program
#mail -s "OEM Agent 13c was not running... Restarted on `hostname` $i `basename $0`" 'EM13c@*****' < agentStarted.log
else
date >> /u01/app/agent13c/log/agentStarted.log
echo 'Agent is running' >> /u01/app/agent13c/log/agentStarted.log
fi
No comments:
Post a Comment