Here we'll give you some instructions on how to integrate PNP4Nagios into the Icinga Web frontend. If you want to integrate PNP4Nagios into the Icinga Classic UI please follow the PNP4Nagios documentation.
On the left you will see the expander icon. Clicking on it opens a bar (shown below the OK sign).
On the right in the "PNP4Nagios" section there are two buttons.
Right-clicking on either of them and selecting "Move into grid" will move the appropriate icon into the grid.
Selecting the new icon opens the PNP graph in a small window showing only one time frame or it will create a new tab showing the usual PNP view.
Clicking on "Setting" and selecting "Reset grid action icons" will remove the inserted icons restoring the default view.
Install PNP4Nagios as described in the PNP4Nagios documentation
Change the PNP4Nagios configuration to match your Icinga configuration. You probably may want to change these:
#> vi npcd.cfg
user = icinga group = icinga log_file = /var/log/icinga/npcd.log perfdata_spool_dir = /var/icinga/spool/ perfdata_file = /var/icinga/perfdata.dump
#> vi process_perfdata.cfg
LOG_FILE = /var/log/icinga/perfdata.log XML_ENC = ISO-8859-1 # use if encountering national character issues
#> vi config.php $conf['nagios_base'] = "/icinga/cgi-bin";
![]() |
Note |
---|---|
Be sure to use existing paths, create them if necessary, and/or adapt the settings to your distribution. Please verify that the Icinga command definitions for "process-host-perfdata-file" and
"process-service-perfdata-file" (probably in |
Since version 1.5 you can leave the grid templates untouched because we integrated XML extension to customize grid templates with simple snippets. PNP integration is made with these extensions to be upgrade safe.
Excerpt from the INSTALL
in contrib/PNP_Integration/
#> cat contrib/PNP_Integration/INSTALL ************************ * INSTALLATION ************************ * To install this addon, simply copy both xml files under templateExtensions * to your icinga-webs app/modules/Cronks/data/xml/extensions folder * and clear the app/cache/CronkTemplates folder * To remove it, just delete the extension files and clear the cache folder again
Install Script
Because it's only copying the two files mentioned there is no script. Sorry.
![]() |
Note |
---|---|
Please note that you will have to reinstall the addon after Icinga-Web upgrade. |
![]() |
Note |
---|---|
The following lines describing the manual integration are for version 1.4 and below |
Create a new grid view
Make a copy of the default icinga-host-template.xml in app/modules/Cronks/data/xml/grid under your Icinga Web installation path, example:
#> cp /usr/local/icinga-web/app/modules/Cronks/data/xml/grid/icinga-host-template.xml \ /usr/local/icinga-web/app/modules/Cronks/data/xml/grid/icinga-my-host-template.xml
In the new file we just created add a new field definition:
<field name="pnp4nagios_host_link"> <!-- datasource maps a data field from api call --> <datasource> <parameter name="field">HOST_NAME</parameter> </datasource> <display> <parameter name="visible">true</parameter> <parameter name="label">Perfdata</parameter> <parameter name="width">55</parameter> <parameter name="Ext.grid.Column"> <parameter name="menuDisabled">true</parameter> <parameter name="fixed">true</parameter> </parameter> <parameter name="jsFunc"> <!-- function to display column with icon in host status grid view --> <parameter> <parameter name="namespace">Cronk.grid.ColumnRenderer</parameter> <parameter name="function">columnImage</parameter> <parameter name="type">renderer</parameter> <parameter name="arguments"> <parameter name="image">images/icons/application_view_gallery.png</parameter> <parameter name="css">x-icinga-grid-link</parameter> <parameter name="attr"> <parameter name="qtip">Show host perfdata for this host</parameter> </parameter> </parameter> </parameter> <!-- create cell click event for the previously defined column --> <parameter> <parameter name="namespace">Cronk.grid.IcingaColumnRenderer</parameter> <parameter name="function">iFrameCronk</parameter> <parameter name="type">cellclick</parameter> <parameter name="arguments"> <parameter name="title">Host perfdata for {host_name}</parameter> <parameter name="url"><![CDATA[/pnp4nagios/index.php/graph?host={host_name}&srv=_HOST_]]></parameter> <parameter name="activateOnClick">true</parameter> </parameter> </parameter> </parameter> </display> <filter> <parameter name="enabled">false</parameter> </filter> <order> <parameter name="enabled">false</parameter> </order> </field>
Add the new grid view to the "Data" cronk-container
Edit cronks.xml in directory app/modules/Cronks/config/ under your icinga-web add a section:
<cronk name="gridMyHostView"> <ae:parameter name="module">Cronks</ae:parameter> <ae:parameter name="action">System.ViewProc</ae:parameter> <ae:parameter name="hide">false</ae:parameter> <ae:parameter name="description">Viewing Host status in a grid including perfdata link</ae:parameter> <ae:parameter name="name">MyHostStatus</ae:parameter> <ae:parameter name="image">cronks.Stats</ae:parameter> <ae:parameter name="categories">data</ae:parameter> <ae:parameter name="ae:parameter"> <ae:parameter name="template">icinga-my-host-template</ae:parameter> </ae:parameter> </cronk>
![]() |
Note |
---|---|
The following lines describing the manual integration are for version 1.4 and below |
Create a new grid view
Make a copy of the default icinga-service-template.xml in app/modules/Cronks/data/xml/grid under your icinga-web installation path.
cp /usr/local/icinga-web/app/modules/Cronks/data/xml/grid/icinga-service-template.xml \ /usr/local/icinga-web/app/modules/Cronks/data/xml/grid/icinga-my-service-template.xml
In the new file we just created add a new field definition:
<field name="pnp4nagios_service_link"> <!-- datasource maps a data field from api call --> <datasource> <parameter name="field">SERVICE_NAME</parameter> </datasource> <display> <parameter name="visible">true</parameter> <parameter name="label">Perfdata</parameter> <parameter name="width">55</parameter> <parameter name="Ext.grid.Column"> <parameter name="menuDisabled">true</parameter> <parameter name="fixed">true</parameter> </parameter> <parameter name="jsFunc"> <!-- function to display column with icon in host status grid view --> <parameter> <parameter name="namespace">Cronk.grid.ColumnRenderer</parameter> <parameter name="function">columnImage</parameter> <parameter name="type">renderer</parameter> <parameter name="arguments"> <parameter name="image">images/icons/application_view_gallery.png</parameter> <parameter name="css">x-icinga-grid-link</parameter> <parameter name="attr"> <parameter name="qtip">Show perfdata for this service</parameter> </parameter> </parameter> </parameter> <!-- create cell click event for the previously defined column --> <parameter> <parameter name="namespace">Cronk.grid.IcingaColumnRenderer</parameter> <parameter name="function">iFrameCronk</parameter> <parameter name="type">cellclick</parameter> <parameter name="arguments"> <parameter name="title">Service perfdata for {service_name} on {host_name}</parameter> <parameter name="url"><![CDATA[/pnp4nagios/index.php/graph?host={host_name}&srv={service_name}]]></parameter> <parameter name="activateOnClick">true</parameter> </parameter> </parameter> </parameter> </display> <filter> <parameter name="enabled">false</parameter> </filter> <order> <parameter name="enabled">false</parameter> </order> </field>
Add the new grid view to the "Data" Cronk-Container
Edit cronks.xml in directory app/modules/Cronks/config/ under your icinga-web add a section:
<cronk name="gridMyServiceView"> <ae:parameter name="module">Cronks</ae:parameter> <ae:parameter name="action">System.ViewProc</ae:parameter> <ae:parameter name="hide">false</ae:parameter> <ae:parameter name="description">Viewing service status in a grid including perfdata link</ae:parameter> <ae:parameter name="name">MyServiceStatus</ae:parameter> <ae:parameter name="image">cronks.Stats2</ae:parameter> <ae:parameter name="categories">data</ae:parameter> <ae:parameter name="ae:parameter"> <ae:parameter name="template">icinga-my-service-template</ae:parameter> </ae:parameter> </cronk>
Using your new created grid view as default (if you want)
Please backup your original view first:
#> cp data/xml/grid/icinga-service-template.xml data/xml/grid/icinga-service-template.bak
then
#> cp data/xml/grid/icinga-my-service-template.xml data/xml/grid/icinga-service-template.xml
Clear the cache, like described below. Performance graphs are now in your default "serviceStatus" Cronk!
© 1999-2009 Ethan Galstad, 2009-2014 Icinga Development Team, http://www.icinga.org