Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010
    Posts
    81

    Unanswered: Sell Script for OEM Agent Status

    Hello,

    does anyone havea shell script to check the status of the OEM Agent running on a solaris 10 box?

    Basically, I am rubbish at scripting, but I'd like a procedure which will
    do the following:

    1) cd into this directory '/u01/app/oracle/product/10.2.0/agent10g/bin
    2) perform a command 'emctl status agent'
    3) The status will either say Agent is running or not running
    4) if the Agent is running - then I would like that in an output file, called
    agent_running.log if not running - then an output file called agent_not_running.log

    I could schedule this job via cron on a hourly basis

    I know it appears quite simple, but like I said I am not too great on shell scripting

    Thanks in advance

  2. #2
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    Code:
    #!/bin/ksh
    cd /u01/app/oracle/product/10.2.0/agent10g/bin
    ./emctl status agent
    if [ $? = 0 ]
    then
       echo Running >agent_running.log
    else
       echo Not running >agent_not_running.log
    fi
    Your logic is pretty rubbish too though. If the agent is not running, and then is started, both log files will exist, and you won't be able to tell anymore whether the process is running or not.

  3. #3
    Join Date
    Jun 2010
    Posts
    81
    OK Thanks for your help and assistance. I supoose I did ask incorrectly

  4. #4
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool EM will do it...

    In Grid control you can set an event to e-mail an alert if any of the agents is down.
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •