Run Scheduled Reports
Overview
The run_scheduled_reports.pl
program is designed to run regularly (by default
every 15 minutes) from the systemd service, using the systemd
timers subsystem. The necessary
systemd configuration files are installed by the n2acd-api
package and
is designed to be run on the middleware (Jarvis execution) environment for
N2ACD (not the reporting server or DB server).
This script manages the scheduled reports to execute as listed in the database
table n2acd.report_schedule
, and updates executed reports in the
n2acd.report_generation_log
log table.
Running run_scheduled_reports.pl --help
will show the program usage.
run_scheduled_reports.pl is used to run scheduled reports and add them to the email queue.
Database connection:
--db-host = N2ACD database host name or IP address. Default = localhost
--db-port = N2ACD database port. Default = 5432
--db-name = N2ACD database name. Default = n2in
--db-connect = N2ACD database connection string. Alternative to
--db-host / --db-port / --db-name providing full
control over the DBI connection string. This may
be useful if [for example] connecting to a
service defined in ~/.pg_service.conf.
--db-user = N2ACD database user name. Default = n2acd_owner
--db-password = N2ACD database user password. If not directly
specified, credentials specified in ~/.pgpass will be used.
--jarvis-config = The Jarvis config file for N2ACD-ADMIN. Default = /etc/jarvis/n2acd-admin.xml
Dataset directory with prefix 'reports.' will be managed by this script.
Common Options
The following common options may be specified when executing:
Option | Type | Default | Description |
---|---|---|---|
--db-host |
String | localhost |
IP address or FQDN of the PostgreSQL database instance to connect to. |
--db-port |
Number | 5432 |
Port number of the PostgreSQL database instance to connect to. |
--db-name |
String | n2in_owner |
Name of the PostgreSQL database that contains the N2ACD schema. |
--db-connect |
PSQL DB Connection String | Alternative option to using --db-host --db-port and --db-name . Specified as a PostgreSQL connection string. See PostgreSQL Connection Strings for more information. |
|
--db-user |
String | n2acd_owner |
The username of the user to connect to the PostgreSQL database instance with. |
--db-password |
String | The password for the user specified with --db-user to connect to the PostgreSQL database instance with. |
|
--jarvis-config |
String /etc/jarvis/n2acd-admin.xml |
The Jarvis XML file that defines the N2ACD administration configuration. |
The following actions are available when executing this script:
Jarvis Configuration
Scheduled reports are run by the this script but use the N2ACD administration
API configuration in the associated Jarvis configuration file (by default
/etc/jarvis/n2acd-admin.xml
) to determine how to deliver the reports
generated.
The configuration required is covered in the administration GUI configuration page.
Deployment Considerations
Report generation relies on the dataset files in the dataset directory prefixed
by reports.
to be available for each API node in a N2ACD environment. If
N2ACD is deployed on multiple SMS nodes the report must be installed on each
node individually.
Further, to avoid downtime on scheduled reports, it is recommended that each ACD SMS middleware layer node is configured to execute this script, as per the scheduling configuration.
Usage Considerations
Accessed to scheduled reporting configuration is governed by the
report_schedule_update
and report_schedule_read
as documented in the
security groups table.