Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated with simplified output setup

...

With opreports-cli you have total control over what formats your reports are generated in, and where they are saved. Please note that reports created by opreports-cli are generally not visible in the GUI, and are not aged!

Precise Output Selection

To generate a report in a format X (html, csv, xlsx), use the options options format_N and and output_file_N (N being a number); e.g. format_1=html output_file_1=/tmp/xyz.html. You can use up to three format/output options (and if you want just one format, then you can leave off the "_N"). If you choose separate output directories, then the resulting report cannot be visible in the GUI.

The output_file_N option value must be a full path pointing to the file to create or replace. Please note that opreports-cli overwrites existing files without warning!

Report formats csv and html can also be printed to stdout, using output_file_N=- (minus sign); Note Please note that this does can not work for xlsx, and only one format can be sent to stdout, and such reports cannot be visible in the GUI.The output_file_N option must be a path pointing to a file. Please note that opreports-cli overwrites existing files without warning!

Simplified Output  Selection

In versions 3.0.10 and newer, there is an optional, simpler mechanism for setting up outputs:

  • Pass the option output_dir=<your desired target directory>,
  • pass the option actual_name=<the short file name>,
  • and pass one or more format_X options, e.g. format_1=csv format_2=html,

and opReports will automatically name the files suitably and put them in the given output directory.

Emailing Reports

In addition to file-based outputs you can also specify email recipients using the email=some@addre.ss,other@addr.ess option. Please note that output_file_N that a file-based output setup is still required. The report will be emailed to all recipients with all selected formats as attachments.

...

  1. All output_file_N options must point to the same directory, and it must be one of the configured report directories (or the on-demand report directory).
    If you use the simplified setup with output_dir, then that must be one of the configured report directories.
    Output to STDOUT (using output_file_1=-) is not allowed in this situation.
  2. All the relative file names given in output_N must be identical (but for the extension).
    this works: format_1=HTML output_file_1=/usr/local/omk/var/reports/on-demand/testme.html format_2=XLSX output_2=/usr/local/omk/var/reports/on-demand/testme.xlsx
    whereas this doesn't: output_file_1=.../test_one.html output_file_2=..../test_two.csv
  3. You must add the option actual_name=<the name of your report files minus extension>.
    For the example from step 2 this would be actual_name=testme.
  4. You must add the option actual_uuid=<unique identifier>.
    The uuid should follow the UUID V4 standard format , but any globally unique string will do.
    You can use the uuid program to create a a proper uuid.
  5. If you want your report to be treated as an instance of a scheduled report, then you must pass the schedule's uuid parameter.
  6. If you want report aging, then you have to add a keep_for=<days> option.

...