Workload Scheduler ReportCLI is an additional component that gives you the possibility to extract historical or customized reports about your workload.
It is a simple zip or tar package you can extract on any machine in your environment that can access the Workload Automation database (read "Setting up for command line batch reporting" for details). In fact it works connecting directly to the database to run queries.
The package contains a configuration property file (config/common.properties) where you can insert configuration information. Each key in this file can be overwritten at runtime but I suggest to use values in this file if you are using reportCLI to run reports from a single environment and use the overwriting method if you need to run reports from different enviroments. For example insert in to common.properties file data about your production environment and override them at runtime if you need to run reports from your test environment.
ReportCLI is also able to attach generated reports to email and send them connecting to your SMTP server. To enable this capability specify PARAM_SendReportByEmail=true; then you need to complete the configuration for email sending by inserting data for SMTP server (mail.smtp.host and mail.smtp.port).
Finally you can customize the email sent by the system in the "Email properties" section.
Now running the command on the reportcli
reportcli.cmd -o \tmp\ -r job_run_history -p C:\reportcli\reports\templates\jrh.properties
an email to the adress (or adresses) specified into PARAM_EmailTo will be sent with the object and text you customized in the common.properties file and attached a zip containing your report generated with the filters in the jrh.properties file.
Starting from this moment your reportcli will send all the generated reports to the addresses into the PARAM_EmailTo key.
reportcli.cmd -o \tmp\ -r job_run_history -p C:\reportcli\reports\templates\jrh.properties -key PARAM_EmailToemail@example.com
will send the email to John Doe independently of the value you have for that key in your common.properties file containing the same zipped file.
Now let see how we can automate the scenario using IBM Workload Scheduler.
Define a jobstream like this:
ON RUNCYCLE RC1 "FREQ=DAILY;INTERVAL=1;BYWORKDAY"
<?xml version="1.0" encoding="UTF-8"?>
<jsdl:jobDefinition xmlns:jsdl="http://www.ibm.com/xmlns/prod/scheduling/1.0/jsdl" xmlns:jsdle="http://www.ibm.com/xmlns/prod/scheduling/1.0/jsdle" name="executable">
<jsdle:executable interactive="false" workingDirectory="C:\reportcli">
<jsdle:script>reportcli.cmd -o \tmp\ -r job_run_history -p C:\reportcli\reports\templates\jrh.properties </jsdle:script>
or using Dynamic Workload Scheduler:
where DYN_AGENT is a dynamic agent running on the machine where you unzipped the reportcli and C:\reportcli is the path where it has been unzipped.
In this example the Workload Scheduler will run the jobstream any workday at 6.00 in the morning so that you can find in your inbox in the morning.
See also "Running batch reports" for more details on reportcli.