Wednesday, 25 August 2021

agent status check scripts for oem13c agent

 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

Featured post

duplicate db from standy to other server

 Duplicate Testuat   $ export ORACLE_SID=Testuat3 $ sqlplus '/as sysdba' Testuat3 SQL> alter system set cluster_database=FALSE sc...