Skip to main content
Version: 6.2

Configuring Scheduled PDF Export

1. Prepare the Components​

PDF export requires:

  • all SA Data Storage cluster nodes with the sm-report, sm-job-scheduler, and opensearch-job-scheduler plugins
  • a SAr Web instance with the smartMonitorPDFExport module and Chromium with the required system libraries
  • an SMTP server accessible from the SA Data Storage nodes

For installation instructions, see SA Data Storage and SA Web. Prepare the Chromium libraries as described in Preparing to export to PDF.

The SA Data Storage nodes must be able to access the PDF generation address and the SMTP server port. SA Web must be able to access SA Data Storage to run dashboard queries.

2. Configure PDF Generation​

Cluster Settings​

Apply these parameters through /_cluster/settings.

ParameterDefault valuePurpose
url_generation_pdfhttps://localhost:5601/Base address of SA Web
report.userEmpty stringUser for accessing the PDF generation service
request_file_timeout120Maximum time to wait for the PDF to be ready, in seconds
sme_request_timeout100Maximum time to wait for a dashboard search query response, in seconds

Replace the address and username in this example with values for your installation:

PUT /_cluster/settings
{
"persistent": {
"url_generation_pdf": "https://sm-web.example.org:5601/",
"report.user": "pdf_service",
"request_file_timeout": 180,
"sme_request_timeout": 100
}
}

Password for the PDF Service​

The password for the report.user account is stored in the keystore under the report.pass key.

Add the password on each SA Data Storage node. The procedure for writing keys is described in Managing Keystore via API.

Node Parameters​

When reading mail configurations, the user's permissions saved in the job are used. If they are absent or cannot be applied, the node parameters are used:

ParameterDefault valuePurpose
job_useradminFallback user for reading SMTP configurations, groups, and recipients
job_user_roles["all_access"]Roles of the fallback user

3. Configure SMTP​

The user must have read access to the selected SMTP configuration, group, and its recipients.

Dedicated SMTP Configuration​

Create a connection through the Job Scheduler API:

POST /_core/job_scheduler/smtp
{
"name": "Отчеты PDF",
"description": "Почтовый сервер для рассылки отчетов",
"host": "smtp.example.org",
"port": "465",
"user": "reports@example.org",
"user_email": "reports@example.org",
"password_id": "pdf_reports",
"timeout": 15000,
"proto": "ssl"
}

Alternatively, add an SMTP configuration in the interface: Main Menu - Settings - Module Settings - Job Scheduler - SMTP Configurations.

The SMTP configuration parameters and procedures for creating groups and recipients are described in the Mail section of the Job Scheduler API article.

System Mail Configuration​

If smtp_id is absent or equals null, the general Job Scheduler mail settings are used. Configure them through the module settings API:

PUT /_core/settings/job-scheduler
{
"email_host": "smtp.example.org",
"email_port": "465",
"email_proto": "ssl",
"email_user": "reports@example.org",
"email_user-email": "reports@example.org",
"email_timeout": 15000
}

The password for the system connection is stored on each node under the jobscheduler.email.pass key.

Test the SMTP Connection​

Test the saved SMTP configuration by substituting its identifier:

POST /_core/job_scheduler/smtp/test_smtp/<smtp_id>

For instructions on manually exporting a dashboard, see Exporting to PDF.