Nagios XI / NagVis - line hover showing performance graph of service

In Nagios XI, how can I get NagVis to show the performance graph of a service that is linked to a line, when you hover the mouse pointer over it?

Currently the popup just shows a summary status of the service, but I would like for it to also show the performance graph.

Hi.

You can generate a copy of the pnp templates for nagvis and replace at the end of the html file

<img src =/pnp4nagios/image?Host=[pnp_hostname]&srv=[pnp_service_description]&display=image&view=0>”

by

<img src=/nagiosxi/includes/components/perfdata/graphApi.php?host=[pnp_hostname]&service=[pnp_service_description]&source=1&view=1>”

In my case it gives me good results

1 Like

@pamuro01

Thanks for your response.

Sorry, I’m still quite new to all of this. Please can you explain in more detail on how to set this up - i.e. where/how pnp templates are found in Nagvis/Nagios XI.

To answer my own question, I have figured out the following.

This is based on Nagios XI 5.6.8 with NagVis 1.9.8

I copied:
/usr/local/nagvis/share/userfiles/templates/default.hover.html

To:
/usr/local/nagvis/share/userfiles/templates/default-pnp.hover.html

In the template HTML, I added the following table row at the end of the table

<tr><td class="label">PNP Graph</td><td><img src='https://#NAGIOS-HOST#/nagiosxi/includes/components/perfdata/graphApi.php?host=[obj_name]&service=[service_description]&view=1&username=#Username#&ticket=#TOKEN#'></td></tr>

Where #NAGIOS-HOST#, #Username# and #TOKEN# are replaced accordingly.

For the gadget object in NagVis I set ‘hover_template’ to ‘default-pnp’.

This seems to work nicely! The graphs are not the ones shown in the rest of Nagios XI, but it’ll do for now.

Thank you to @pamuro01 for the hint!

After testing this solution for a few hours, what I have noticed is that sometimes the hover menu does not appear for some of the objects, even after you leave the mouse over the object for a while.

I have found the only way to (temporarily) resolve this, is to reload/refresh the Nagvis map.

Hi Solarmon and Happy new Year!!

I recommend doing the following:

1.- Download the nagvis template: nagiosxi-pnp.hover.zip (684 Bytes)
2.- Unzip the template in the directory: /usr/local/nagvis/share/userfiles/templates/
3.- Change file permissions: chown apache.nagios nagiosxi-pnp.hover.html
4.- In Nagvis modify the object and assign the template in the “Action” menu, option “Hover_Template”

With that it should work well, I have tested it in my environment without problems.

regards

Pablo
xmartic.com / Chile

1 Like

@pamuro01

Happy New Year to you too!

Thanks for the steps. That is what I more or less figured out!

Using your hover template I’m still getting the issue where the hover popup windows will not appear.

This issue seems to occur for gadget objects that uses ‘std_html_bar.php’ to display the value of the service for that object. Whenever the value of the service changes, the hover window does not appear and I have to refresh the NagVis map for it to work again. So this is a bit annoy.ing that you have to keep manually refreshing.

@pamuro01

I notice the following issue, which may or may not be related to the issue of the hover popup window not appearing.

The template has the following line at the start of it:

<link rel="stylesheet" type="text/css" href="[html_templates]/tmpl.default.css" />

However, [html_templates]/tmpl.default.css doesn’t exist. The existing CSS file default.hover.css does exist, so should/could this be used instead?

Regarding my issue of the popup hover window not appearing, I don’t think it is a browser issue. I normally use Chrome but I tested with Internet Explorer and the same issue occurs - the popup hover window does not appear after the gadget changes to a different value.