Is it possible to run (using a script) a Performance Analytics Data collection job?

cristian1988
Tera Contributor

Hi gurus!

I´m wondering if such thing is possible, I have PA Data Collection job that runs "on demand" using 2 basic parameters:

- A fixed start date and a fixed end date

-a couple of existing indicators that are added in the indicators list

 

Currently in our operation we select manually those parameters but im wondering if there is a way for us to run a script on demand also to run that recollect data job.

 

I really thank you in advance for your suggestions!

 

5 REPLIES 5

marekzakroc
Tera Contributor

Hi,
I was looking at similar requirement and found how to execute a job via a script:

 
var paJobGR = new GlideRecord('sysauto_pa');

if(paJobGR.get('sys_id', <job_sys_id>)) {
    SncTriggerSynchronizer.executeNow(paJobGR);
}
 
That just executes so in order to add some parameters to it, you would need to script updates on "sysauto_pa" table for fixed start/end dates for that specific job.
In order to manipulate the list of indicators for the job, you would need to insert/delete records relation in "pa_job_indicators" tables for that specific job.
 
Prior to that execute script of course.
 
Kind regards
Marek