Changes

From Amahi Wiki
Jump to: navigation, search
75 bytes removed ,  16:10, 17 July 2018
# Unzip browser_detect.js to ''/var/hda/web-apps/icinga/html/''
# Create /var/hda/web-apps/icinga/html/index.html with the following contents.
{{Text|Text=
<pre><nowiki><html>
<head>
<body>
</body>
</html></nowiki></pre>}}
= Icinga Plugins =
* Download latest [http://sourceforge.net/projects/pnp4nagios/files/PNP-0.6/ PNP4Nagios from sourceforge] and move it to ''/usr/local/src/''
* Install the following packages
{{Code|<pre>yum install <nowiki>perl rrdtool rrdtool-perl</nowiki> -y}}</pre>
=== Set up PNP4Nagios ===
More compiling!
{{Code|<pre>
cd /usr/local/src/
tar -xzf pnp4nagios-0.6.13.tar.gz
./configure <nowiki>--with-nagios-user=icinga --with-nagios-group=icinga --with-httpd-conf=/etc/httpd/conf.d</nowiki>
make all
make fullinstall}}</pre>
Change some PNP4Nagios settings
{{Code|<pre>sed -i 's/\/nagios\/cgi-bin/\/icinga\/cgi-bin/' /usr/local/pnp4nagios/etc/config.php}}</pre>
Apache integration for PNP4Nagios.
{{Code|<pre>
cd /etc/httpd/conf.d/
sed -i 's/nagios\/etc\/htpasswd.users/icinga\/etc\/htpasswd.users/' pnp4nagios.conf
vim 1002-icinga.conf
rm pnp4nagios.conf
service httpd restart}}</pre>
Visit http://icinga/pnp4nagios/ and make sure all tests pass. Then remove the install.php file.
{{Code|<pre>rm /usr/local/pnp4nagios/share/install.php}}</pre>
Now enable processing performance data in Icinga. Edit icinga.conf and set ''process_performance_data=1''.
{{Code|<pre>vim /usr/local/icinga/etc/icinga.cfg}}</pre>
Uncommend the following lines in /usr/local/icinga/etc/icinga.cfg.
{{Text|Text=<pre>
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdata}}
command_name process-service-perfdata
command_line /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl
}</nowiki></pre>}}</pre>
Restart Icinga
{{Code|<pre>service icinga restart}}</pre>
Now PNP4Nagios is installed. You can visit PNP4Nagios by going to http://icinga/pnp4nagios
==== Classic Interface ====
Add the following lines to the top of ''/usr/local/icinga/etc/objects/templates.cfg''
{{Text|Text=
<pre><nowiki>define host{
name host-pnp
action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
register 0
}</nowiki></pre>}}
Edit /usr/local/icinga/etc/objects/templates.cfg and within the ''generic-host'' definition add the following line underneath "''name generic-host''".
{{Text|Text=<pre><nowiki>use host-pnp</nowiki></pre>}}
Edit /usr/local/icinga/etc/objects/templates.cfg and within the ''generic-service'' definition add the following line underneath "''name generic-service''".
{{Text|Text=<pre><nowiki>use srv-pnp</nowiki></pre>}}
==== New Interface ====
First make backup copies of the configuration files you need to modify.
{{Code|<pre>
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}}</pre>
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 -->
<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 -->
<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|<pre>/usr/local/icinga-web/bin/clearcache.sh}}</pre>
12,424

edits