Automic Workload Automation

Expand all | Collapse all

How to check if SAP is up?

  • 1.  How to check if SAP is up?

    Posted 11-17-2020 06:52 AM
    Hello,

    Does anyone suggest a way (script / command) to check if SAP is active?

    Thank you!
    Rodrigo


  • 2.  RE: How to check if SAP is up?

    Broadcom Partner
    Posted 11-17-2020 09:16 AM
    Hi Rodrigo,

    I assume you have an Automic Agent connected to the SAP system. So you can use SYS_HOST_ALIVE as described here

    :set &sap_alive# = sys_host_alive ("sapagent", "conn.r3.sapagent")

    regards,
    Peter

    ------------------------------
    Capture Europe
    ------------------------------



  • 3.  RE: How to check if SAP is up?

    Posted 11-17-2020 09:32 AM
    Hello Peter,

    Thank you for the Reply!

    Yes, but this "sys_host_alive" will only check if the agent is alive, not the system itself.
    I could not find a way to check if the system itself is up.


    Thank you!
    Rodrigo


  • 4.  RE: How to check if SAP is up?

    Broadcom Partner
    Posted 11-17-2020 09:40 AM
    Hi Rodrigo,

    have you used both values, agent and conn object?

    regards,
    Peter

    ------------------------------
    Capture Europe
    ------------------------------



  • 5.  RE: How to check if SAP is up?

    Posted 11-17-2020 01:35 PM
    Hi Peter,
    You are right. This can be an option. I will make some tests.
    Thank you!
    Rodrigo


  • 6.  RE: How to check if SAP is up?

    Posted 12-03-2020 09:07 AM
    Hello Peter,

    I am back to this topic again. I realized that using the agent and connection together, if the agent is up and the system is down, the script stays as "waiting for the server". For me does not make sense. If both are up, the anaylis is correct.

    The Atributes are empty because I am defining the entries using an include on the Pre-Process. Process are empty too. O the Post-Process I did the check:

    :IF sys_host_alive ("&SAP_SID#", "CONN_&SAP_SID#") = "N"
    xx
    :ENDIF

    Do you have an idea?

    Thanks Rodrigo


  • 7.  RE: How to check if SAP is up?

    Broadcom Partner
    Posted 12-03-2020 09:51 AM
    Hi Rodrigu,

    I suppose you have created a JOBS, not a SCRI object, right?

    regards,
    Peter

    ------------------------------
    Capture Europe
    ------------------------------



  • 8.  RE: How to check if SAP is up?

    Posted 12-03-2020 10:03 AM
    Yes. it is a JOBS.
    I saw somewhere that should be executed in the post-processing.


  • 9.  RE: How to check if SAP is up?

    Broadcom Partner
    Posted 12-03-2020 10:09 AM
    Checking SAP should be done from a SCRI object. As you experienced, if the SAP system is not up the JOBS will wait and wait and wait ...
    But a SCRI object will check and end normally.

    ------------------------------
    Capture Europe
    ------------------------------



  • 10.  RE: How to check if SAP is up?

    Posted 12-03-2020 10:15 AM
    Sorry I was not clear. The need to use the Post_Processing was the use of command MODIFY_STATE, which I am using in order to block the workflow where the job is included.

    :IF sys_host_alive ("&SAP_SID#", "CONN_&SAP_SID#") = "Y"
    xx
    : MODIFY_STATE RETCODE=1800
    xx
    :ENDIF

    Do you suggest any other command to block the execution and stop the workflow where the job is included? If I have another option I can try to use SCRIPT object again.



  • 11.  RE: How to check if SAP is up?

    Broadcom Partner
    Posted 12-05-2020 01:22 AM
    Hi Rodrigo,

    in case that an agent (Windows, Unix, SAP, RAFTP, ...) is not active the JOBS will wait for the agent (status "waiting for host"). I can see 2 options:

    check the Agent status from the PreProcess tab in object properties:

    check the Agent status in the preProcess tab of the JOBS:
     if you have to check in many JOBS, create an INC onject and reference it in the PreProcess tab.

    regards,
    Peter

    ------------------------------
    Capture Europe
    ------------------------------



  • 12.  RE: How to check if SAP is up?

    Posted 11-20-2020 02:01 AM
    Hello Rodrigo,
    we check SAP with an SAP-Job running a "dummyreport" like "BTCSPOOL". If the job fails -> SAP or the agent is not alive.
    Bye Bernhard

    ------------------------------
    Landeshauptstadt München
    ------------------------------



  • 13.  RE: How to check if SAP is up?

    Broadcom Employee
    Posted 11-20-2020 03:21 AM
    Hello

    Running the ABAP RSPARAM would be fine also:

    R3_ACTIVATE_REPORT REPORT=RSPARAM,VARIANT=TEST

    You have to make sure that the Variant Test actually exists. If this is not,
    you can create this variant with the SE38 transaction,
    choose another already existing Variant,
    or leave the paramater Variant.

    RSPARAM is a standard ABAP program that lists the SAP profile paramers, and it is present on any system.

    https://www.se80.co.uk/sapreports/r/rspa/rsparam.htm



  • 14.  RE: How to check if SAP is up?

    Posted 12-03-2020 09:24 AM
    Edited by Rodrigo Cunha 12-03-2020 09:25 AM
    Hello, Thanks for the reply.

    We thought this, but in this case I am afraid to create misunderstanding about the reason of non execution.
    Regards, Rodrigo