CA Workload Automation ESP Edition

Expand all | Collapse all

Route LINUX Jobs to Other Systems

Jump to Best Answer
  • 1.  Route LINUX Jobs to Other Systems

    Posted 11-27-2018 05:15 PM

    Hello,

     

    I have a request from client to route Linux job on another server ( AGENT B ) if we already have 30 jobs in executing status on (AGENT A).

    Can we  use something similar to

    ROUTE XEQ(NODE2) if all resources are in use ? or if there is any other good option?

     

    LINUX_JOB PAYROLL_JOB1 

     AGENT A

    RESOURCE ADD(1,xyz)  /* maximum resource defined 30 */

    ROUTE XEQ(AGENT B)

    RUN DAILY

    SCRIPTNAME testing.ksh

     

    USER admin

    ENDJOB

     Lucy_zhang

     #esproute

     

    Thank you for your help



  • 2.  Re: Route LINUX Jobs to Other Systems
    Best Answer

    Posted 11-27-2018 05:59 PM

    Hi, 

    The below may not work for you but it may get you closer.  When the MAX() count is set to 30  I think it will round robin between the two servers so each ends up with 15 jobs.  There may be a way to set a server preference. In the example there are 5 servers but your example only needs two,  Also change the MAX(1)  TO  MAX(30) . 

     

    The jobs will move to an available server.

    My example is for Austria. NOTE: DPU01, 2, 3, 4, 5 are my server names.

     

    STEPS 

    Defined 5 AGENTS in AGENTDEF 

        DPU01,DPU02,DPU03,DPU04,DPU05     

        

    Define Node

        NODE AUSTRIA ADD 

        

    Define CPUs

        CPU DPU01 ADD NODE(AUSTRIA) AGENT(DPU01) 

        CPU DPU02 ADD NODE(AUSTRIA) AGENT(DPU02) 

        CPU DPU03 ADD NODE(AUSTRIA) AGENT(DPU03) 

        CPU DPU04 ADD NODE(AUSTRIA) AGENT(DPU04) 

        CPU DPU05 ADD NODE(AUSTRIA) AGENT(DPU05) 

          

    Define RESDEF        

        RESDEF RESAUSTRIA ADD NODE(AUSTRIA) CPU(DPU01) LOCAL RENEWABLE GRAVITY MAX(1) 

        RESDEF RESAUSTRIA SET NODE(AUSTRIA) CPU(DPU02) MAX(1) 

        RESDEF RESAUSTRIA SET NODE(AUSTRIA) CPU(DPU03) MAX(1) 

        RESDEF RESAUSTRIA SET NODE(AUSTRIA) CPU(DPU04) MAX(1) 

        RESDEF RESAUSTRIA SET NODE(AUSTRIA) CPU(DPU05) MAX(1) 

        

    Define JOBs similar to the one below.  Each job has ROUTING and the resource RESAUSTRIA in it.  

    NT_JOB DPCMD001                                      

          RUN ANY                                           

          RESOURCE (1,RESAUSTRIA)                               

          CMDNAME "C:\PROGRAM FILES\CA\SCRIPTS\TEST.BAT"    

          AGENT DPU01 ROUTING                          

    ENDJOB   

     

    Let me know if there are any questions. 



  • 3.  Re: Route LINUX Jobs to Other Systems

    Posted 11-28-2018 08:50 AM

    If you are willing to write some REXX you could create a SYMLIB to determine which Agent Name.to use.

     

    In the Linux Job you would invoke the SYMLIB which would set the %AgentName

     

    ESP Job Definition

    LINUX_JOB JOB1                                    
      INVOKE '<SYMLIB>'
      AGENT %AgentName                                 
      SCRIPTNAME <script>                      
      RUN ANYDAY                                         
    ENDJOB  

                                                                      

    Let me know if you think this would work in your environment and I can show you how to set it up.