Stuck with installation pnp in icingaweb2

This forum was archived to /woltlab and is now in read-only mode.
  • I'm completely new to Icinga. I've got my server running. Now I want to expand icingaweb2 with pnp. But to be honest, I haven't got any clue what I'm doing. I can't find any clear howto or tutorial. Who can help me out?


    :(


    My server runs Debian 8.0 (Jessie) x64, default icinga2 and icingaweb2 installed according the official documentation.

  • You'll install PNP4Nagios as package on its own and configure it for usage with Icinga 2.

    https://docs.icinga.com/icinga…ddons#addons-graphing-pnp


    You'll then download and enable the PNP module for Icinga Web 2 and point it to your /pnp4nagios web path.

    https://github.com/Icinga/icingaweb2-module-pnp#installation


    An example integration can be found inside the icinga2x Vagrant box.

  • Ja, ich spreche auch ein bißchen Deutsch. Um Antworten auf Fragen für mehr Menschen online zuf Verfügung zu stellen, bevorzuge ich Englisch.


    I've found and used https://www.unixe.de/icingaweb2-und-pnp4nagios/. The two pages contain a contradiction in the file

    Code
    1. /etc/pnp4nagios/config.php

    and that makes it confusing which one is right. Do you have to comment nagios_base out or not?

    Code
    1. $conf['nagios_base'] = "/cgi-bin/icinga";

    My log shows an error code:


    As you can see the the graphs are not appearing.



  • I'm a bit further, but still I'm confused. For a true newbie are Icinga and Pnp4nagios a true challange. :/ I'm not giving up, because I believe the products are great once they are configured right. My avatar is right. I'm a true beginner. :whistling:


    Wolfgang : Which user and which command do you mean?


    My observations. The files in in the perfdata directory are automatically removed, as supposed as I understand. I only see two hosts in rrdcached directory like in my previous post. The graphs don't appear in Icingaweb2. I've got the impression that npcd is running in bulk mode instead of npcdmod mode.


    I don't see any entry with npcdmod appearing. According to the documentation of pnp4nagios I need to see something like this:

    Code
    1. [1277545053] npcdmod: Copyright (c) 2008-2009 Hendrik Baecker (andurin@process-zero.de) - http://www.pnp4nagios.org
    2. [1277545053] npcdmod: /usr/local/pnp4nagios/etc/npcd.cfg initialized
    3. [1277545053] npcdmod: spool_dir = '/usr/local/pnp4nagios/var/spool/'.
    4. [1277545053] npcdmod: perfdata file '/usr/local/pnp4nagios/var/perfdata.dump'.
    5. [1277545053] npcdmod: Ready to run to have some fun!
    6. [1277545053] Event broker module '/usr/local/pnp4nagios/lib/npcdmod.o' initialized successfully.

    This is what I see in the log.

    Outcome of npcd -d -f:

    My local users:

    My nagios.cfg:

    My npcd.cfg:

    I hope I've given enough information now.

  • The problem here is that the PNP docs do not provide details on the Icinga 2 installation. You'll need to choose the mode which is bulk mode with npcdmod and NPCD. Instead of the NEB module npcdmod, Icinga 2 provides the feature "perfdata". This must be enabled like written here: https://docs.icinga.com/icinga…ddons#addons-graphing-pnp


    After configuring NPCD to pickup the correct performance data spool files you'll need to restart the NPCD daemon and everything should start to work on its own.


    In case you make it happen, doc patches are always appreciated.

  • Hi


    the following steps worked for me:


    Code
    1. icinga2 feature enable perfdata
    2. service icinga2 restart

    Then change the /etc/pnp4nagios/npcd.cfg

    Code
    1. perdata_spool_dir = /var/spool/icinga2/perfdata

    Edit the /etc/default/npcd (RUN="no" to RUN="yes")

    Start the npcd-service

    Code
    1. service npcd start

    Then you have to copy and link the apache config

    Code
    1. cp /etc/pnp4nagios/apache.conf /etc/apache2/sites-available/pnp4nagios.conf
    2. cd /etc/apache2/sites-enabled/
    3. ln -s /etc/apache2/sites-available/pnp4nagios.conf pnp4nagios.conf
    4. service apache2 reload
    Code
    1. cd /usr/share/icingaweb2/modules
    2. git clone https://github.com/Icinga/icingaweb2-module-pnp pnp

    In icingaweb2 you have to enable the module pnp and the graphs should be displayed

  • Okay, I wasn't expecting this rollercoaster ride. I'm about to give up. I lack the knowledge to integrate pnp4nagios into Icingaweb2. The documentation of pnp4nagios isn't helpful either. Also I lack a deep knowledge of Linux in general needed for this task. Gents, I'm sorry.

  • Okay, I wasn't expecting this rollercoaster ride. I'm about to give up. I lack the knowledge to integrate pnp4nagios into Icingaweb2. The documentation of pnp4nagios isn't helpful either. Also I lack a deep knowledge of Linux in general needed for this task. Gents, I'm sorry.

    Don't give up but learn. The feeling once you've got it working is far better than leaving it half-half. There's many users in this thread who are trying to help you here, take this chance!

  • You've convinced me to go on. This weekend I'm going to work in my own little lab hoping to make some progress. This evening I'll make some more specific questions.

  • I'm reading and taking notes for possible howtos and docs. The difficult bit will still be installing PNP, the Icinga Web 2 module is just a small step away. Just take your time and go on step by step, as described in #9.

  • This is a log from how I'm doing it. For me it's a black box. I'm just trying to obey the manuals.

    • Are my file rights correct?
    • Are the file locations correct?
    • Is using backports enough?
    • Most of all, is the configuration of pnp4nagios correct?


  • This is what I see when I open http://*/pnp4nagios/ in my browser.


    monitoring-portal.org/woltlab/cms/index.php?attachment/8909/


    monitoring-portal.org/woltlab/cms/index.php?attachment/8910/


    Perhaps handy to know:

    Code
    1. root@dditsticinga:~# perl verify_pnp_config --mode npcdmod --config=/etc/pnp4nagios/nagios.cfg --pnpcfg=/etc/pnp4nagios
    2. [INFO] ========== Starting Environment Checks ============
    3. [INFO] My version is: verify_pnp_config-0.6.25-R.40
    4. [INFO] Start Options: verify_pnp_config --mode npcdmod --config=/etc/pnp4nagios/nagios.cfg --pnpcfg=/etc/pnp4nagios
    5. [INFO] Reading /etc/pnp4nagios/nagios.cfg
    6. [INFO] Can´t determine product while reading /etc/pnp4nagios/nagios.cfg
    7. [CRIT] /etc/pnp4nagios/nagios.cfg does not look like a valid config file
  • Hm, the approach of copying the web config file to /etc/pnp4nagios is somewhat uncommon, I'd copy such into /etc/apache2/sites-available/ and then run a2ensite pnp4nagios.


    You also don't need to add the action_url attributes in /etc/icinga2/zones.d/master/template_host-pnp-host.conf - the Icinga Web 2 module will automatically detect the required URLs to fetch the rendered graph images from.


    Furthermore you don't need to edit the nagios.cfg and add the event broker lines. That has no effect - Icinga 2 provides its "own" perfdata writer by running "icinga2 feature enable perfdata". By default it will use the path /var/spool/icinga2/perfdata as you've set in your npcd.cfg config already.


    Going further - pnp_verify does not support Icinga 2 yet, and neither the docs mention it. So you'll manually need to verify and trust the config, as you've posted it here already (good).


    Looking at the initial error code you've got from NPCD - error code 5 - which translates into an IO problem, I would guess that there's still a permission problem. Can you please show the output of


    Code
    1. ps aux | grep npcd
    2. ls -laR /var/spool/icinga2
  • These are my changes:

    • Moved /etc/pnp4nagios/apache2.conf to /etc/apache2/sites-available/pnp4nagios.conf and enabled it using a2ensite. I was surprised to see it in several examples.
    • I've commented out the action_url lines in /etc/icinga2/zones.d/master/template_host-pnp-host.conf and /etc/icinga2/zones.d/master/template_host-pnp-service.conf.
    • I've removed the two added lines from nagios.cfg.
    Code
    1. /etc/icinga2/zones.d/master/template_host-pnp-host.conf
    2. template Host "pnp-host" {
    3. # action_url = "/pnp4nagios/graph?host=$HOSTNAME$' class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=_HOST_"
    4. }
    5. /etc/icinga2/zones.d/master/template_host-pnp-service.conf
    6. template Service "pnp-service" {
    7. # action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=$SERVICEDESC$"
    8. }

    Code
    1. root@dditsticinga:~# ps aux | grep npcd
    2. nagios 60200 0.1 0.0 387652 4052 ? Sl 16:33 0:00 /usr/sbin/npcd -d -f /etc/pnp4nagios/npcd.cfg
    3. root 60761 0.0 0.0 12728 2144 pts/1 S+ 16:34 0:00 grep npcd



  • Ok, so npcd is running as nagios user and as such the perfdata files written by Icinga 2 are owned by the same user. npcd should be able to read the rotated files and then remove them. I assume the errors inside the npcd.log are still there and nothing is written to to the rrd files, right?


    Unfortunately your attached screenshots do not work. Can you upload them again, ans directly insert them into your post?