以下の内容はhttps://htn20190109.hatenablog.com/entry/2025/05/01/072913より取得しました。


EMエージェント再起動シェル

 

su - oracle
cd /u01/app/oracle/agent/agent_inst/bin
./emctl status agent

 

cat <<-'EOF' > restart_em_agent.sh
#!/bin/bash

HOSTMEI=$1

echo "[$(date '+%Y/%m/%d %H:%M:%S')] job start" | tee -a  /tmp/restart_em_agent_$(date '+%Y%m').log

ssh ${HOSTMEI} "sudo su - oracle -c '/u01/app/oracle/agent/agent_inst/bin/emctl stop agent'" 2>&1 | tee -a /tmp/restart_em_agent_$(date '+%Y%m').log

RET=$?
if [ ${RET} -ne 0 ] ; then
  echo "[$(date '+%Y/%m/%d %H:%M:%S')] em stop error( ${RET} )" | tee -a  /tmp/restart_em_agent_$(date '+%Y%m').log
  exit 100
fi

ssh ${HOSTMEI} "sudo su - oracle -c '/u01/app/oracle/agent/agent_inst/bin/emctl start agent'" 2>&1 | tee -a /tmp/restart_em_agent_$(date '+%Y%m').log

RET=$?
if [ ${RET} -ne 0 ] ; then
  echo "[$(date '+%Y/%m/%d %H:%M:%S')] em start error( ${RET} )" | tee -a  /tmp/restart_em_agent_$(date '+%Y%m').log
  exit 100
fi

echo "[$(date '+%Y/%m/%d %H:%M:%S')] job end" | tee -a  /tmp/restart_em_agent_$(date '+%Y%m').log
exit 0

EOF

 

cat restart_em_agent.sh
chmod +x restart_em_agent.sh


./restart_em_agent.sh mmm114

cat /tmp/restart_em_agent_$(date '+%Y%m').log

 

 

 

 




以上の内容はhttps://htn20190109.hatenablog.com/entry/2025/05/01/072913より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14