Icinga

Installation of the Icinga-Reporting with JasperServer

The Icinga-Reporting is based on the IDOUtils backend and just like the Icinga-Core, it will support all major database platforms.

Here we'll give you some instructions on how to install the Icinga-Reporting with JasperServer.

Prerequisites

You need Icinga-Core and IDOUtils installed and running. Icinga-Reporting also requires a system to run the JasperServer based on Tomcat.

[Note] Note

If you don't have Icinga yet please follow the instructions given in the "quickstart-idoutils" documentation.

Install the JasperServer

You can use the JasperServer installation binary or the specific WAR-Archive to deploy the software in an existing engine.

Install Tomcat using your OS repositories

Fedora/RHEL/CentOS/openSuSE/SLES

 #> yum install tomcat6

Debian/Ubuntu

 #> apt-get install tomcat6

Install JasperServer CE into your Tomcat Server

After successful JasperServer installation the interface is reachable at http://<yourhost>:8080/jasperserver and you are able to login with jasperadmin/jasperadmin and go to the next step. Please change the default password as soon as possible.

In case of any errors consult the JasperServer Troubleshooting Guide

Download the Templates

Install the Icinga-Reporting package

Unpack the downloaded file and copy it to your JasperServer directory.

 #> tar xzvf icinga-reports-xxx.tar.gz
 #> cp icinga-reports-<-version>/jasperreports/package/icinga-reports.zip /opt/jasperserver/scripts/
 #> cd /opt/jasperserver/scripts/

Importing the whole reporting package requires just one command:

 #> ./js-import.sh --input-zip icinga-reports.zip

If you want to update an existing repository please use the following command:

 #> ./js-import.sh --input-zip icinga-reports.zip --update

You can export the whole Icinga part of the repository with the following command:

 #> ./js-export.sh --uris /Icinga --output-zip icinga-reports.zip
[Note] Note

If the import scripts fails, please check your jasperserver.xml for the current user and password. You can change the default user and password in <jasperserver-ce-dir>/scripts/config/js.jdbc.properties

[Note] Note

The export-/import-process is explained in detail in chapter 5.12 of the JasperServer CE-Install-Guide

Install the JAVA classes for SLA-Reports

Generating automatic reports for last week, last month or last year requires to calculate the dates automatically for the specific reports. To use that feature you have to install the icinga-reporting.jar archive into the Jasper lib directory. It should be in the WEB-INF folder of your installation. Please don't forget to restart your jasper-server after installation.

Configure quartz the scheduler

The reporting distribution is done via quartz scheduler. To configure the sender mail and your local gateways please edit the following file <tomcat_home>/webapps/jasperserver/WEB-INF/js.quartz.properties. Please restart the tomcat server to activate the new settings.

service tomcat6 restart or /etc/init.d/tomcat restart

Configure your database connection

Login to http://localhost:8080/jasperserver with jasperadmin/jasperadmin.

After a successful package installation you will find the datasource here:

/root/Icinga/datasource (be sure that Refine contains "changed by anyone").

- Edit the existing datasource and configure your values.

- Test the configuration and save the connection.

- All reports in our package point to this datasource and should be able to run.

[Note] Note

Remember to clear the search field and set the 4 dropdowns to the following positions to find the datasource:

After this is done, hit search to "apply" the filters. Now you should be able to see the data sources. Default for dropdown filter #2 is Visualization type, which hides data sources.

Different table prefix

If you changed your table prefix during installation you can replace the existing prefixes using the following script.

 grep -l -r " icinga_" .  | xargs sed -i.BAK -e 's/ icinga_/ /g'
 grep -l -r "icinga_" . | xargs sed -i.BAK -e 's/^icinga_//g'
 find . -iname "*BAK" -exec rm -f {} \;

Known Bugs: If you don't see any graph labels in a PDF export please switch from OpenJDK to SUNJava.

Figure 9.1. Icinga-Reporting in Icinga-Web

Icinga-Reporting in Icinga-Web


Figure 9.2. Icinga-Reporting TOP10 in Icinga-Web

Icinga-Reporting TOP10 in Icinga-Web


Integration into Icinga-Web

Prerequisites

Install

The reporting cronk is fully integrated into Icinga-Web so you don't have to install anything additional.

Configuration

Depending on your current environment you have to configure the cronk to set the Jasper server location and user credentials. The configuration is set in the reporting module

 $ cd app/modules/Reporting/config/
 $ ls autoload.xml config_handlers.xml module.xml routing.xml
 $ vi module.xml
 <!-- Jasper configurations -->
 <setting name="jasperconfig.default">
    <ae:parameter name="jasper_url">http://10.121.0.95:8080/jasperserver</ae:parameter>
    <ae:parameter name="jasper_user">jasperadmin</ae:parameter>
    <ae:parameter name="jasper_pass">jasperadmin</ae:parameter>
    <ae:parameter name="tree_root">/Icinga/reports</ae:parameter>
 </setting>
 <!-- Custom config if I have more that one -->
 <!--
 <setting name="jasperconfig.custom1">
    <ae:parameter name="jasper_url">http://127.0.0.175/jasperserver</ae:parameter>
    <ae:parameter name="jasper_user">custom_user</ae:parameter>
    <ae:parameter name="jasper_pass">custom_passwd</ae:parameter>
 </setting>
 -->

Please alter the jasperconfig.default to suit your environment and change jasper_url, jasper_user and jasper_pass.

You can integrate more than one Jasper server. The configuration name will be included into the reporting cronk later. Please select a unique name for each configuration.

The XML configuration is prefixed. The full name for 'jasperconfig.default' is modules.reporting.jasperconfig.default. The long name is the real config setting for using in the cronks configuration.

The default /Icinga/reports is the path for the icinga-reporting package but you can run every report configured with Jasper through the cronk. If you want to use different people for different locations you have to create more cronks with groups_only permissions.

Cronk configuration

The Jasper config is ready. Now you need a cronk and tell it which configuration you want to use. Go to your cronk configuration (cronks.xml) and add a new cronk like the following:

[Note] Note

Due to config changes between 1.4 and 1.5 there are several locations for the cronk settings. Please have a look in the other document resource where it could be

 <cronk name="icingaReportingDefault">
    <ae:parameter name="module">Reporting</ae:parameter>
    <ae:parameter name="action">Cronk.Main</ae:parameter>
    <ae:parameter name="hide">false</ae:parameter>
    <ae:parameter name="description">Seamless Jasper Integration</ae:parameter>
    <ae:parameter name="name">Reporting</ae:parameter>
    <ae:parameter name="categories">reporting</ae:parameter>
    <ae:parameter name="image">cronks.Weather Could Sun</ae:parameter>
    <ae:parameter name="ae:parameter">
       <ae:parameter name="jasperconfig">modules.reporting.jasperconfig.default</ae:parameter>
       <ae:parameter name="enable_onthefly">1</ae:parameter>
       <ae:parameter name="enable_repository">1</ae:parameter>
       <ae:parameter name="enable_scheduling">1</ae:parameter>
    </ae:parameter>
 </cronk>

Have you noticed the configuration string? This is the string you configured in the module.xml shown in the topic before.

You can also enable some modes for this cronk:

Feel free to edit our sample reports with iReport and change these to your needs :)

That's all, you're done!