Opsview Knowledge Center

Customizing a Report

Some of the above standard reports can be modified to suit individual needs, such as excluding all SOFT errors from the 'Weekly Availability' report. The following steps can be used to modify an existing report.

Note: If a report or sub-report is customized it should be saved under a new name - all standard reports are reset to default on an upgrade and many sub-reports are used in a number of other reports.
To customize a report, first find the report 'jrxml' under /opt/opsview/jasper/reports on the server. Also, look for 'subreportExpression' within the file to identify what sub reports (other jrxml files) are called. This will identify all the reports that need to be amended.

When all the required reports and subreports have been identified, copy them to your local machine for amending (the files are later uploaded back into Jasper via a web browser session). Rename each of the files as appropriate (e.g. by using the name suffix 'Hard'):
mv WeeklyAvailability.jrxml WeeklyAvailabilityHard.jrxml

Edit each of the jrxml files and look for all the sub-report references ('subreportExpression') to rename each of those to use the same suffix.

Then, edit each of the jrxml files to amend the SQL queries as necessary. To have the report ignore soft errors, look for each of the following database table columns and amend as follows:

Soft error column names Hard error only column names
seconds_not_ok seconds_not_ok_hard
seconds_warning seconds_warning_hard
seconds_critical seconds_critical_hard
seconds_unknown seconds_unknown_hard

This can be achieved by using the following Perl code:

perl -p -i -e 's/(seconds_not_ok|seconds_warning|seconds_critical|seconds_unknown (\W)/${1}_hard${2}/g' *.jrxml

When all the changes have been made, the modified report can be uploaded back into Jasper by logging into the Jasper UI as an administrator, right click on 'Reports', 'Add Resource', and select 'JasperServer Report'.
The name should be the main report filename without the jrxml, and the label should be the same but with spaces between words.

Name WeeklyPerformanceByServiceHard
Label Weekly Performance By Service Hard

Click Next.
Locate the jrxml file from your local filesystem and click Next.
Click 'Add Resource' for each sub-report that was also modified and fill out the forms in the same way as the main report (load in jrxml file and fill in the Name and Label fields).
Click 'Add Controls' and use the same ones as the original report, selecting the control from the repository. When all is done, click Next.
Select the ODW data source from the repository and click Next.
Then click 'Finish' and 'Save'.
You should now be able to run your report.

Customizing a Report