Automic Workload Automation

 View Only

  • 1.  clarification on code

    Posted Oct 09, 2024 11:12 AM

    Hello team, 

    Please check the below code

    :READ &uc_ex_host,,
    :PSET &AGENT# = &uc_ex_host
    :set &status# = get_var(VARA.AGENTMONITOR,"Status")
     
    :WAIT 30
    :SET &ALIVE# = SYS_HOST_ALIVE(&AGENT#)
     
    :if &status# = "On"
    :IF &ALIVE# NE 'Y'
    :  SET &ACT# = ACTIVATE_UC_OBJECT(CALL.UC_EXECUTOR_END_DEMO,,,,,PASS_VALUES)
    :ENDIF
    :ENDIF
    In the above code what does the line :set &status# = get_var(VARA.AGENTMONITOR,"Status")
    And the line :SET &ALIVE# = SYS_HOST_ALIVE(&AGENT#) is doing? 

    As per my knowledge both are using fetching the status of the agent.
    So, can I remove any one of the above codes?
    Can you please tell me if both line are required.

    Thanks,
    Gagan S N



  • 2.  RE: clarification on code

    Broadcom Employee
    Posted Oct 10, 2024 02:18 AM
    Edited by Markus Embacher Oct 10, 2024 02:19 AM

    Hi,

    it looks like this is a SCRI object which gets triggered from UC_HOSTCHAR_DEFAULT / EXECUTE_ON_END / LOST.

    SYS_HOST_ALIVE checks the whether the Agent is alive - I'm attaching the link for your reference:

    https://docs.automic.com/documentation/webhelp/english/AA/24.2/DOCU/24.2/Automic%20Automation%20Guides/Content/Script/Reference/SYS_HOST_ALIVE.htm

    get_var reads a value from a VARA object by the key "Status". However I cannot tell you how that value gets updated in that VARA object, since it is not a VARA object that is delivered with Automic, it has been created specifically in your environment.

    Please check if there are any other scripts that are updating that VARA object to find out whether this is required anymore or not.

    Regards, Markus