Hello Community,
for our automated patch process for servers i´m trying to create a "maintenance-mode" for the awa-agents.
High-Level Idea:
1. set agent resources to 0
2. check for active tasks
3. wait, till active task are finished
4. run preparing jobs via awa
5. change entry in uc_ex_hostchar to "patch_mode" for involved agents ("workload_max_job = 0" and "workload_max_ft = 0" so that resources of the agent after a restart are still zero)
6. server patching ()
7. run post processing jobs
8. set agent resources to unlimited
9. change entry in uc_ex_hostchar to "default" for involved agents
Details:
The steps 1,2,3,8 and 9 are easy to develop. But with the steps 4 and 7 as well as 5 and 9 i´ve got some problems.
Step 4 and 7
To run jobs during the agent resources are limited isn´t that easy as expected. In the documentation it is written:
"Use the MODIFY_UC_OBJECT function in the scripts of both Workflows in order to set them to Ignore Agent Resource. This step is required because no other tasks must run at this time. Ignore Agent Resource then applies to all objects that are started by these two workflows."
(https://docs.automic.com/documentation/webhelp/english/AWA/12.2/DOCU/12.2/AWA%20Guides/help.htm#_Common/BestPractices/AWA_Admin/BestPractices_ControlledComputerRestart.htm%3FTocPath%3DAdministering%2520and%2520Configuring%7CManaging%2520your%2520AWA%2520System%7C_____6)
So I tried to use :SET &MODOBJ# = MODIFY_UC_OBJECT(&$RUNID#, SET_EXPRESS, "ON") in the process tab of the maintenance workflow. But sadly with no effect on the jobs inside the workflow. They were still waiting for agent resources.
Then I developed a script object, which "scans" the activation report of the maintenance workflow for activated Tasks.
SET &HND# = PREP_PROCESS_REPORT(, &RUNNR#, "ACT","*RUNID*", "COL=DELIMITER", "DELIMITER=*'*")
:PROCESS &HND#
: SET &RET_RUNNR# = GET_PROCESS_LINE(&HND#,4)
: SET &MODOBJ# = MODIFY_UC_OBJECT(&RET_RUNNR#, SET_EXPRESS, "ON")
:ENDPROCESS
This works for workflows, which aren´t nested. For complex ones, you would need recursion, which isn´t possible with uc4 script. Or I need to develop some sql-statement to retrieve all needed RUNIDs.
Step 5 and 9
I would like to change the value in uc_ex_hostchar via uc4 script, but it is not possible to run something on client 0000. So the only way I see here is to change the variable via application interface.
I would like to know if someone has got other solutions for such a use case. What are your best practices?
I´m looking forward to your ideas.
Best regards
Stephan
------------------------------
Application Manager/Admin
Debeka
------------------------------