This whitepaper describes howto use JasperReports to create and generate reports based on the Bareos database. There is  plenty of information inside the catalog. To extract useful information visualize and analyze it, the widely used open source tools from JasperSoft suite can be used to create those reports.

We focus on Bareos here but the basic idea and most reports apply to Bacula, too.


Database access

You need to have read access to the Bareos catalog database from the system where you run the report engine. For Jaspersoft beginners we recommend to use the Java desktop client iReport (runs on Linux, MacOS and Windows). This means you need to grant select-access to a database user, connecting from your desktop to the catalog database, including all tables.

Installing Jasper

We recommend to start with the desktop application iReport, which can be downloaded here: http://community.jaspersoft.com/download. There is a tutorial about iReport here: http://community.jaspersoft.com/wiki/ireport-designer-tutorials-help.

Make sure that you can connect from iReport to your Bareos database and use this connection for the next reports. If you have more than one catalog database, you can configure all of them and connect to them  by selecting one from the picklist "Datasources" in the iReport toolbar.



This sample report has been succesfully tested with Postgres as database backend. A quick test with MySQL did not succeed.

Now load the first sample definition report3.jrxml and the subreport report3_subreport1.jrxml. This sample creates a report for a dedicated client and produces to charts: a graph showing the number of bytes according to the last full backup jobs. The second graph shows the allocation of stored client backup's to pools.

You can  run the report by clicking on the "Preview " tab. Now a popup window asks for a client name (here the name as configured in the client resource), after specifying a valid client name, a pdf document with your report should appear.

Depending on your installation, some fonts might be missing. If you encounter font related error messages, this article might help: http://community.jaspersoft.com/wiki/ireport-fonts.

If everything worked, you get a report like the sample above for the backup client called "futurama-fd".


To be continued

The above report is just an example of the potential that JasperReports has to generate all kind of reports regarding Bareos and Bacula backups.

If you follow the mentioned iReport tutorial you might be able to define further Bareos reports. Just let us know, we would like to setup a repository for reports and share them.

There are some other samples here: http://breport.sourceforge.net/ and a different approach for reporting without Jasper here: http://www.reportula.org/reportula/

Go back