Documentation

Reporter scripting

It enhances Reporter feature.
It is available only in the Enterprise edition of the product.

You can run whatever defined report in this scripting way and further work with generated output.
It is useful when you want the generated report data/graphs to send or copy somewhere, if you want to import already exported data into 3rd party tools etc.

Another advance is your own scheduling (via crontab). STOR2RRD execute reports only once a day (1st run after the midnight).

When report is intended to be used only via this scripting then you can set in STOR2RRD UI option “no recurrence” in “Recurrence rule” window or select "Disabled" on report properties.

Run report manually

Under stor2rrd user:
. /home/stor2rrd/stor2rrd/etc/stor2rrd.cfg ; sh ./bin/genreport.sh <user> <report name> 

Example

$ . /home/stor2rrd/stor2rrd/etc/stor2rrd.cfg ; sh ./bin/genreport.sh admin "CSV test" 

  manual startup : bin/genreport.sh "admin" "CSV test"
  reporter START : Mon Nov 19 09:18:03 2018
  ...
  zip report     : admin/CSV_test/20181119_091803/* to /home/stor2rrd/stor2rrd/reports/admin/CSV_test/CSV_test-20181119_091803.zip
  emails found   : 0
  download       : /home/stor2rrd/stor2rrd/reports/admin/CSV_test/CSV_test-20181119_091803.zip
  stored zip     : /home/stor2rrd/stor2rrd/reports/admin/CSV_test/CSV_test-20181119_091803.zip
  stored report  : /home/stor2rrd/stor2rrd/reports/admin/CSV_test/20181119_091803
  reporter END   : Mon Nov 19 09:18:13 2018
Script returns "1" as the exit code when report creation fails.

Crontab planning

Star report each 6am under stor2rrd user:
$ crontab -e
0 6 * * *  . /home/stor2rrd/stor2rrd/etc/stor2rrd.cfg ; sh ./bin/genreport.sh admin "CSV test" > /var/tmp/stor2rrd-report-CSV_test.out 2>>/var/tmp/stor2rrd-report-CSV_test.err

How to disable report recurrence

When defining a report add the option “no recurrence” in “Recurrence rule” window or select "Disabled" on report properties.