Tuesday, February 19, 2008

Script for Checking Java Mailer Status

---------------------------------Script Start-----------------------------------
#!/bin/ksh
#Script to monitor WF Mailer Status
. .env
cd /tmp
sqlplus /nolog << EOF
connect apps/password
set heading off
set pages 0
set feedback off
spool monitor_mailer.lst
select COMPONENT_STATUS from FND_SVC_COMPONENTS
where COMPONENT_ID='10006';
spool off
EOF
MONITOR=`grep -v "SQL>" monitor_mailer.lstsed s/\ //g`

if [ $MONITOR != "RUNNING" ] ; then
echo $MONITOR mailx -s "WFMAILER: Check Workflow Mailer STATUS" sudubey@gmail.com
fi
/bin/rm -f /tmp/monitor_mailer.lst
-----------------------Script End -------------------------------------------------

Put this in crontab for every 10 min or so. It will send a status whenever its not running. No more OAM checking !!!!

Note: This has been tested in Sun Solaris

Keep Troubleshooting !!!

4 comments:

Anonymous said...

I'm not good at Linux, but your code on Linux ES 4 is not working....Do you maybe have some errors?

Sundeep Dubey said...

Hi, I have tested this in Sun Solaris servers. There might be some syntax issue in linux. Or Just use the sql command, you will get the complete status in email.

Thanks
Sundeep

htaieb said...

Hi Sundeep,

Please find under other version of your script :


-----------------------------------

#!/bin/ksh
#Script to monitor WF Mailer Status
. .env

MONITOR=`sqlplus -s apps/password < < EOF
set feedback off
set verify off
set heading off
select COMPONENT_STATUS from FND_SVC_COMPONENTS
where COMPONENT_ID='10006';
exit;
EOF`


if [ $MONITOR != "RUNNING" ] ; then
echo $MONITOR mailx -s "WFMAILER: Check Workflow Mailer STATUS" sudubey@gmail.com
fi

-----------------------------------





Regards,

Harry (DBA Oracle Applications)

Oracle Applications DBA said...

Hi Sandeep,

Nice Post, It helped me today in setting up a cron script.

Now iam planning for deploying this script Enterprise Manager.

Thank you.

Jagadish.