Idea Details

Allow PUT_ATT Host for Agentgroups

Last activity 16 days ago
Stephan Schiller's profile image
04-03-2019 07:41 AM

It is not possible to set agentgroups for the attribute 'host' via 'PUT_ATT' for any object. An error occurs as follows:

"U00020357 Runtime error in object 'TEST1(1)', line '00001': Host 'HOSTG.TEST' does not exist."

 

To use agentgroups efficiently it would be great to allow PUT_ATT Host for agentgroups primarily for object type JOBS, but also for any other object types.


Comments

04-17-2019 11:30 AM

The most recent version of my JOBI includes a SEC_SQLI that can read the mode of an agent group. See automation_engine/Resolve_agent_group.md at master · michael-lowry/automation_engine · GitHub 

 

Here’s my suggestion for how to handle mode=all:

  1. If mode=all and the parent task type is e.g. JOBP (the first run), run ACTIVATE_UC_OBJECT inside the PREP_PROCESS_AGENTGROUP loop, and start additional copies of the job — one for each member of the agent group. For this initial run, just set the agent to anything, and skip the actual content of the job. Pass the agent name to the started jobs via a prompt buffer.
  2. If the parent task type is not JOBP (the job was started via ACTIVATE_UC_OBJECT), read the agent name from the prompt buffer, use :PUT_ATT to set it, and run the normal content of the job.

04-17-2019 11:07 AM

Hi Michael,

 

thank you for the link to your scripting, this is very helpful.

 

But I miss the feature mode=all. Because of that and because an implementation by Automic/Broadcom
would be much easier to use, I still adhere to the feature request.

 

By the way I have an idea how to add the mode=all feature to your script:

 

What about setting a flag for mode=all of agentgroups (either get_att for the "mode attribute" (don´t know if it´s possible) or when PREP_PROCESS_AGENTGROUP returns more than one agent). Then put all agents of that agentgroup into a VARA object and add an additional line with a counter. In the post process it is possible to restart the job (RESTART_UC_OBJECT). So, count up counter and restart job. In your main skript another query has to be implemented, something like "if agentgroup mode = all and VARA.Agentgroup exists, get_var VARA.AGENTGROUP,&counter else put_var VARA.AGENTGROUP. When the execution is finished, delete VARA.AGENTGROUP. Might work, but as mentioned above it´just an idea. I haven´t scripted or tested something like that.


rgds

 

Stephan

04-15-2019 09:52 AM

04-11-2019 10:02 AM

Hi Christian,

 

thank you for your help. With this solution we can realize some of our use cases.

 

Nevertheless it would be fine to set agentgroups via PUT_ATT.

 

rgds

Stephan

04-08-2019 05:59 AM

Hi Stephan,

of course, here you're

 

define hostgroup

 

define Variable with hostgroup

 

use curly brackets syntax in jobs.unix

rgds

Christian

04-08-2019 05:47 AM

Hi Christian,

 

we´ve tried differnt ways to set the host with the curly bracket notation, but unfortunately it didn´t work.

Could you give me an example?

 

rgds

Stephan

04-08-2019 03:51 AM

Hi Stephan,

up to version 12.2 you can use the curly brackets syntax to put the agent group into the host field, then the execution works fine even you use agent groups.

rgds

Christian

04-03-2019 10:39 AM

Hi,

 

you are right. We even use this possibility to evaluate and set the appropriate agent for jobs from an agentgroup.

 

But for me this is another reason to allow the put_att for agentgroups, because with PREP_PROPCESS_AGENTGROUP it is very inconvenient to let a job run e.g. on more than one agent (mode "all_active").

04-03-2019 09:59 AM

Hi, as an alternative you can PREP_PROCESS_AGENTGROUP your desired AGENTGROUP to evaluate the Agent, which can be stored to HOST field by using PUT_ATT.