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?
RESOURCE ADD(1,xyz) /* maximum resource defined 30 */
ROUTE XEQ(AGENT B)
Thank you for your help
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.
Defined 5 AGENTS in AGENTDEF
NODE AUSTRIA ADD
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)
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.
CMDNAME "C:\PROGRAM FILES\CA\SCRIPTS\TEST.BAT"
AGENT DPU01 ROUTING
Let me know if there are any questions.
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.