There are two agents installed on two application servers in AWS. Normally agent wobs should be sent to AGENTA, and when AGENTA is down, ESP Workload Automation system should send them to AGENTB.
There is no cluster or load balancer to redirect the agent wobs to the second agent.
Component: ESP Workload Automation & Workload Automation System Agent
Release: ALL
Here are the steps:
#1 Define both agents in AGENTDEF, and then issue "OPER LOADAGDF" to make them effective:
AGENT AGTA ......
AGENT AGTB ......
#2 Define AGENT_MON for both agents:
AGENT_MON AGTA
AGENT AGTA
NOTIFY PNODE(INACTIVE) EVENT(ESP.CHANGE_AGENT)
STATINTV 5
MSGQLEN 10
ENDJOB
AGENT_MON AGTB
AGENT AGTB
NOTIFY PNODE(INACTIVE) EVENT(ESP.CHANGE_AGENT)
STATINTV 5
MSGQLEN 10
ENDJOB
#3 Define event ESP.CHANGE_AGENT:
EVENT ID(ESP.CHANGE_AGENT) SYSTEM(-) REPLACE
PROC
IF %MNAGENT EQ 'AGTA' THEN -
VSET AGENTNAME 'AGTB' TABLE(AGENT)
IF %MNAGENT EQ 'AGTB' THEN -
VSET AGENTNAME 'AGTA' TABLE(AGENT)
ENDPROC
ENDDEF
#4 Define the global variable table and variable:
VTDEFINE AGENT
VSET AGENTNAME 'AGTA' TABLE(AGENT)
Note: the above command can also be issued manually from ESP page mode if needed.
#5 Use the variable on AGENT statement in ESP Proc:
APPL applname
....
VGET AGENTNAME TABLE(AGENT)
SAP_JOB jobname
....
AGENT %AGENTNAME
....
ENDJOB
Note:
1. Normally all agent wobs will be sent to AGTA since it's the value for variable %AGENTNAME;
2. When AGENT_MON for AGTA shows Inactive, NOTIFY will fire event ESP.CHANGE_AGENT, which will change the variable value to AGTB;
3. Then new agent wobs will be sent to AGTB.
4. From agent side, after the switch, the inactive agent may need to clean up the database file.
For question on shared spool folder, the doc links below show clearly that you can specify spooldir with same location and folder:
Configure Agent Aliases for Clustered Environments