Changes

From Amahi Wiki
Jump to: navigation, search
4,178 bytes added ,  04:46, 19 July 2011
no edit summary
If you have any questions then please contact me.
-- [[User:Sag47|Sag47]] 1421:2446, 17 18 July 2011 (PDT)
= What is Icinga? =
=== Integrating PNP4Nagios into Icinga ===
Read [http://docs.pnp4nagios.org/pnp-0.6/webfe PNP4Nagios documentation] for integrating PNP4Nagios into the Icinga Classic web interface. Read the [http://docs.icinga.org/1.42.0/en/icinga-web-pnp.html Icinga documentation] for integrating PNP4Nagios into the new Icinga Web 2.0 interface.
==== Classic Interface ====
Add the following lines to the top of ''/usr/local/icinga/etc/objects/templates.cfg''
{{Text|Text=
<pre><nowiki>use srv-pnp</nowiki></pre>}}
 
==== New Interface ====
First make backup copies of the configuration files you need to modify.
{{Code|
cd /usr/local/icinga-web/app/modules/Cronks/data/xml/grid/
cp icinga-host-template.xml icinga-host-template.bak
cp icinga-service-template.xml icinga-service-template.bak}}
Now edit ''icinga-host-template.xml'' and right before the line ''<field name="host_info">'' add the following following field definition.
{{Text|Text=
<pre><nowiki><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></nowiki></pre>}}
Edit ''icinga-service-template.xml'' and right before the line ''<field name="service_info">'' add the following following field definition.
{{Text|Text=
<pre><nowiki><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></nowiki></pre>}}
You now have to clear the Icinga Web cache to finalize applying the settings you changed.
{{Code|/usr/local/icinga-web/bin/clearcache.sh}}
61

edits