Hi,
From your script --- it will go through the Process (at the end of the process, &HOST# = last agent in the group). Once :PROCESS is done, it will then assign the attribute HOST with &HOST#.
In Statistics, you will see that the job was run against &HOST#, once.
Even if you place PUT_ATT HOST = &HOST# inside :PROCESS, the result will be the same. Because the job is activated once and it will run against the last agent found in the group.
If you want a job to run against all the agents found in the group:
1) without assigning the HostGroup (mode=ALL) in the Attributes tab
2) and using PREP_PROCESS_AGENTGROUP
Then you will need to activate the job for each agent it will run against.
Example (Note that there are other ways to do this, this is just one example):
1) create a SCRI that will activate your job (eg: SCRI.TRIGGER)
:SET &HND# = PREP_PROCESS_AGENTGROUP("HOSTG.CCH.WIN",,ALL)
:PROCESS &HND#
: PSET &AGENT# = GET_PROCESS_LINE(&HND#,1)
: SET &STATUS# = GET_PROCESS_LINE(&HND#,2)
: PRINT "Agent: &AGENT#"
: PRINT "Status: &STATUS#"
: IF &STATUS# = "Y"
:SET &ACT# = activate_uc_object(JOBS.WIN.CCH.HOSTG,,,,,PASS_VALUES)
: ENDIF
:ENDPROCESS
2) In Pre-Process tab of the job JOBS.WIN.CCH.HOSTG, assign a value to attribute HOST (from SCRI.TRIGGER)
:PUT_ATT HOST = &AGENT#
You may also want to check out the link below. The list of agents is in a VARA object and retrieved by a key. You can loop through the the VARA result as well and activate a job for each agent found.
https://community.automic.com/discussion/7404/u00020554-data-sequence-couldnt-be-written-into-a-file-agent-hostg-***-isnt-active-at-the-moment