Facing issue in integarting PNP plugin for graphing

pnp4nagios

(Sunil) #1

Hi

I have enabled pnp module in icinga2 and followed instructions in links below -


https://icinga.com/docs/icinga2/latest/doc/13-addons/#pnp

When I click on PNP link in Icinga2 web, iget below error -
The requested URL /pnp4nagios/index.php/graph was not found on this server.

I also verified configuration using verify_pnp_config file
perl verify_pnp_config -m bulk+npcd --config=/etc/nagios/nagios.cfg --pnpcfg=/etc/pnp4nagios
This script is showing one error - NPCD daemon is not running.
I tried restarting npcd, bu when I check status it shows Active (exited).

I am new to icinga. Please tell me if I am missing any important step.

Also tell me do I need to first install PNP by following instruction in https://docs.pnp4nagios.org/ or the above two links are enough to follow.

Thanks
Sunil


(Carsten Köbke) #2

I would not go for pnp anymore with icinga2. Better use Graphite + Grafana or InfluxDB + Grafana.


#3

Tough I have use pnp4nagios in many setups, I agree with Carsten. I will switch to graphite in the future, as it is the more modern approach. And pnp4nagios and the pnp module will most likely not get many updates in future.

pnp4nagios is quite easy to install, once you have figured it out and made some script to do it. Until then it can be a pain in the … :wink:
Also, in my experience, it only works well in non-HA scenarios and has trouble when adding or removing perf data to existing checks. Tough these might be config issues on my end.

I will show you what I was doing when installing pnp4nagios. Compare it to the steps you have done, maybe do it step by step and understand what is done.
This is for Debian/Ubuntu systems and apache2 web servers, if you have anything else you might need to adapt a few things.

apt-get -qy install gcc make rrdtool rrdcached librrds-perl

wget -O /tmp/pnp4nagios_latest.tar.gz https://sourceforge.net/projects/pnp4nagios/files/latest/download 
pnp4nagios_src=$(tar -tzf /tmp/pnp4nagios_latest.tar.gz | head -1)
tar -C /usr/local/src -xzf /tmp/pnp4nagios_latest.tar.gz
cd /usr/local/src/${pnp4nagios_src}

./configure --prefix=/opt/pnp4nagios \
	--bindir=/usr/bin \
	--sbindir=/usr/sbin \
	--sysconfdir=/etc/pnp4nagios \
	--with-perfdata-spool-dir=/var/spool/icinga2/perfdata \
	--with-perfdata-logfile=/var/log/pnp4nagios/perfdata.log \
	--with-perfdata-dir=/var/lib/pnp4nagios/perfdata \
	--with-httpd-conf=/etc/apache2/conf-available

make all 
make fullinstall 
cd -

sed -i -e'/Order allow.*/d' \
       -e's/Allow from all/Require all granted/g' \
       -e's/\(Auth.*\)/\#\1/g' \
       -e's/\(Require valid-user.*\)/\#\1/g' \
       /etc/apache2/conf-available/pnp4nagios.conf

sed -i 's/^\$views\[\]/#$views[]/g' /etc/pnp4nagios/config_local.php

a2enconf pnp4nagios

sed -i '/DocumentRoot/a\
\
                # Redirect to Subfolder icingaweb2\
                RedirectMatch ^\/$ \/icingaweb2\/' /etc/apache2/sites-available/default-ssl.conf

sed -i '/DocumentRoot/a\
\
        # Rewrite to HTTPS\
        RewriteEngine On\
        RewriteCond %{HTTPS} off\
        RewriteRule ^\/?(.*)$ https:\/\/%{HTTP_HOST}\/$1 [R=301,L]' /etc/apache2/sites-available/000-default.conf

systemctl restart apache2.service
/etc/init.d/npcd restart

rm /opt/pnp4nagios/share/install.php

git clone https://github.com/Icinga/icingaweb2-module-pnp /usr/share/icingaweb2/modules/pnp

As said I`d still suggest you get familiar with graphite and/or grafana.


#4

I’d said that’s incorrect when using Icinga 2. --config=/etc/icinga2/icinga2.conf should be more appropriate (please adjust to your enviroment).