opReports Post Report Script

In opReports, a Post Report Script can be configured to run automatically after a report is completed.

This configuration is accessible via the Advanced tab in the Create Report dialog in opReports. You can find it at opReports > Views > Report Schedules > Create one-off Report or Create recurring Report on the Advanced tab.

Within the Advanced tab, you can select from a dropdown menu to choose the specific Post Report Script you wish to execute once the report generation is finished.

Screenshot 2024-08-21 at 10.32.44 am.png

One example of a Post Report Script has been documented in the following example: Automatically copy opReports to another server using SFTP

 

 

 

How to setup a Post Report Script

The script can be executed using the following command:

perl opreports-sftp.pl filename=<output_report_csv> outputdir=<outputdir_report_csv> completed_time=<time_when_report_csv_was_generated>

Note: Ensure this as a Perl script, not as an executable or shell script.

Configuration Parameters

With the release of opReports 4.6.1, we have introduced a new configuration parameter: opreports_post_report_script_timeout. This parameter allows you to specify a timeout duration for the Post Report Script. By setting this parameter, you can control the maximum amount of time the Post Report Script is allowed to run, ensuring that it doesn't hang indefinitely or run longer than expected.