Heya, On Thu, Jun 02, 2016 at 05:14:23PM +0200, Antony Stone wrote:
> Has anyone managed to get pnp4nagios graphs working with Icinga2? Yes -- kind of. :) All the components seem to work fine, but clicking on an Action link in Icinga Web 2 opens the pnp4nagios graphs in a new tab ... (still trying to figure out how to configure the action_url to show the graphs in Icinga Web 2). [...] > I've followed the instructions in paragraph 16.1.1 from the URL above: > > - install pnp4nagios package > - enable icinga2's perfdata feature > - restart icinga2 > - set the perfdata_spool_dir for npcd > - restart npcd Anyway, here is what I did on Debian 8, Jessie, 64 bit. I was mainly following this link https://tipstricks.itmatrix.eu/installing-icinga2-in-debian-wheezy/: - apt-get install --no-install-recommends pnp4nagios rrdcached - enable the perfdata feature - restart icinga2 - edit /etc/default/npcd and set RUN to "yes" - set the perfdata_spool_dir for npcd - restart npcd - create directory /var/cache/rrdcached and change owner to nagios - edit file /etc/default/rrdcached and add the following line: OPTS="-w 1800 -z 1800 -j /var/cache/rrdcached -s nagios -m 0660 -l unix:/var/run/rrdcached.sock" - edit the file /etc/pnp4nagios/config.php (as described in that link) and modify $conf['nagios_base'] and $conf['RRD_DAEMON_OPTS'] - edit the file /etc/pnp4nagios/process_perfdata.cfg as described In my /etc/icinga2/conf.d/templates.conf I put the following new entries: template Host "pnp-hst" { action_url = "/pnp4nagios/graph?host=$HOSTNAME$" } template Service "pnp-svc" { action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$" } I'm also using import "pnp-hst" in my generic-host template. (Note that I'm not really sure about the action_url, as it opens the graph in a new browser tab and not in Icinga Web2 itself. Maybe someone else can explain how to set the action_url the correct way.) > I can confirm that I am getting data fed into the RRDs under > /var/lib/pnp4nagios/perfdata Yep. Same here. > I then get stuck. The next sentence in the instructions is "There's also an > Icinga Web 2 module for direct PNP graph integration available at > https://exchange.icinga.org/icinga/PNP4Nagios" - that URL gives me a 404 Not > Found. Yes, you can download the module from https://exchange.icinga.org/icinga/PNP or the GitHub repository: https://github.com/Icinga/icingaweb2-module-pnp I created a new directory called pnp in /usr/share/icingaweb2/modules, extracted the .zip file in there, went to the Icinga Web 2 interface | Configuration | Modules and enabled the pnp one. When I look at hosts in Icinga Web 2, I can something like Problem handling Comments Add comment Downtimes Schedule downtime Actions Action 1 Clicking on Action 1, I can see the pnp4nagios graphs (on a new browser tab). > The final sentence is "More information on action_url as attribute and graph > template names." which refers to paragraph 16.8. > > It's not clear to me whether I should be following the instructions in > paragraph 16.8.1 (it says "Icinga Web 2 doesn't require the action url > attribute in its own module" - does that mean Icinga Web 2 doesn't require it > at all, or just that it doesn't have to be in its own module?) No clue, but will try to find out. :) > Paragraph 16.8.2 seems to have incomplete instructions: > > - the "apply Service" stanza has no "assign" or "for" statement, so Icinga2 > rightfully complains on reload > > - the sentence "If there are warnings about unresolved macros make sure to > specify a default value for vars.pnp_check_arg1 inside the" just stops there. Indeed. I will look into that and try to improve that chapter of the documentation. Cheers, Heike _______________________________________________ icinga-users mailing list icinga-users@lists.icinga.org https://lists.icinga.org/mailman/listinfo/icinga-users