Automic Workload Automation

 View Only
  • 1.  awa 12.3 how to test of an objet CONN before transferring files

    Posted Jun 17, 2022 02:20 PM
    Hello
    In AWA 12.3 (windows 2019), I have an objet connexion to do some files transferts.
    Thoses transferts are often in error because the connexion is lost before starting !

    I would like, in order to have less errors, to test the connexion and then to do the transfert :
        1/ test the connexion
             if ok:
        2/ job of transfert
            else : nothing, bye bye

    can you help ?


    thanks a lot

    Marc Broussard
    EQUANS INEO


  • 2.  RE: awa 12.3 how to test of an objet CONN before transferring files

    Posted Jun 20, 2022 11:01 AM
    :INC JOBI.GET_CLIENT, NOFOUND = IGNORE
    01 !this include script returns 1 in prod, 2 in UAT, and 3 in Dev
    02 !Use &PC_NUM# as an arg in variable lookups ie
    GET_VAR(("VARA.STATIC.FIREWALL.DATA", "HW", &PC_NUM#)
    03 :SWITCH &$CLIENT#
    04 !adding 1000 as alternate prod environment for lb dr evolution
    05 :CASE 0100
    06 :PSET &PC_NUM# = 1
    07 :CASE 0102
    08 :PSET &PC_NUM# = 2
    09 :CASE 0101
    10 :PSET &PC_NUM# = 3
    11 :ENDSWITCH
    12
    13 :IF &$SYSTEM# = 'AUTODR'
    14 : PSET &PC_NUM# = 1
    15 :ENDIF

    :SET &LV_CONNECTION# = GET_VAR("VARA.STATIC.FIREWALL.DATA", "DB_CONN",
    &PC_NUM#)

    :PSET &PV_CONN_TEST# = SYS_HOST_ALIVE(,&LV_CONNECTION#)

    :P Connection to database &LV_CONNECTION# alive? &PV_CONN_TEST#

    --
    <http: www.verizon.com="">

    Scott Hughes

    IT Network Services

    O 949 286 7668
    M 505 373 7872
    7000 Central Blvd SW
    Albuquerque, New Mexico 87121




  • 3.  RE: awa 12.3 how to test of an objet CONN before transferring files

    Posted Jun 21, 2022 11:56 AM
    Thanks Hugues

    This command works for agent (I tested it, second ligne of the log bellow ), probably for database connexion, but I do think that it works for FTP Connexion objet (first result in the log bellow)


    the script:

    :PSET &test1# = SYS_HOST_ALIVE(XXXX.FTPCONN.XXX)
    :PSET &test2# = SYS_HOST_ALIVE(AGENTXX)

    2022-06-21 11:28:25 - U00020237 The object variable '&TEST1#' in object: 'SCRI.TEST_CONNEXION', line: '00001' (RunID: '0113008519') has been created with the value 'N' by  using the command :PSET.
    2022-06-21 11:28:25 - U00020206 Variable '&test1#' was stored with value 'N'.
    2022-06-21 11:28:25 - U00020237 The object variable '&TEST2#' in object: 'SCRI.TEST_CONNEXION', line: '00002' (RunID: '0113008519') has been created with the value 'Y' by  using the command :PSET.
    2022-06-21 11:28:25 - U00020206 Variable '&test2#' was stored with value 'Y'.



    any other idea ?

    thanks a lot



  • 4.  RE: awa 12.3 how to test of an objet CONN before transferring files

    Posted Jun 28, 2022 09:28 AM
    hello
    just an update to get more help!
    Nobody  knows how to know if (s)FTP connexion is working, using OA scripting ?

    Thanks a lot

    Marc Broussard
    Equans INEO


  • 5.  RE: awa 12.3 how to test of an objet CONN before transferring files

    Posted Jun 28, 2022 04:57 PM
    Hi @marc broussard,

    To me it seem's that Automic scripting (sys_host_alive) doesn't work with FTP-Agents/ CONN-objects. I tested it ​on V21. Instead of scripting I would use an FTP Job (JOBS.FTP) as a predecessor of the actual FTP job. This pre-job just runs a simple command like an ls. It fails when it can't connect. You than use the Post-Condition to restart the pre-job as long as it can't connect. The downside is that you'll possibly have a lot of ENDED_NOT_OKs for the pre-job. If you don't want to have that => scripting is your friend ;-) 





    Cheers
    Christoph

    ------------------------------
    ----------------------------------------------------------------
    Automic AE Consultant and Trainer since 2000
    ----------------------------------------------------------------
    ------------------------------



  • 6.  RE: awa 12.3 how to test of an objet CONN before transferring files

    Posted Jun 29, 2022 03:17 AM
    I agree
    thanks