Include perf graph in email notification

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Include perf graph in email notification

Post by snapon_admin »

Trying to get graph data added to emails. I've got 2 attachments here, one showing what our current notifications look like, and one showing what I want to add to it.

What it looks like now:
notification.png
What I want to add:
notificationgraph.png
I have noticed that right clicking on the perf graph allows the option to copy the image link, I just need to know if there's anyway to wildcard it so that it pulls the graph for the right service on the right host. Long shot, and it's probably not possible, but I figured it wouldn't hurt to check.
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Include perf graph in email notification

Post by abrist »

I think main issue here is that our notification php script does not have the logic to do this at this time. It would need to generate the relevant graph image and then attach it to the email. You could try to shoe-horn just the link in, but that will not work due to the XI authentication. (though you may be able to use a ticket_id) Also, the notification script would have to do some url encoding for the hostname/service_description (as they can contain illegal url characters like spaces).

You might be able to pull something like this off with a custom notification handler script (instead of the XI one), but you would have to roll your own.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
IMTECH
Posts: 53
Joined: Fri Nov 25, 2011 6:35 am

Re: Include perf graph in email notification

Post by IMTECH »

This is something that we also need to implement at the moment.

Are there currently any plans to provide this directly using the XI Notification handlers?
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Include perf graph in email notification

Post by WillemDH »

Hey,

I'm not sure if this is possible to integrate in email (didn't test it yet) but this might be a solution to embed a Higchart graph in a HTML email as long as the email is read internally. Check out this thread:

https://support.nagios.com/forum/viewto ... highcharts

Grtz
Nagios XI 5.8.1
https://outsideit.net
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Include perf graph in email notification

Post by rkennedy »

Thanks Willem! @IMTECH - let us know if this helps you.
Former Nagios Employee
IMTECH
Posts: 53
Joined: Fri Nov 25, 2011 6:35 am

Re: Include perf graph in email notification

Post by IMTECH »

Hi,

I tried to integrate it using iframe but I only get an empty frame.

Code: Select all

<iframe width=800 src="http://x.x.x.x/nagiosxi/includes/components/graphexplorer/graph.php?host=%host%&service=%service%&width=400&height=300&username=putuserhere&ticket=puttokenhere" />
I fear it could have issues with executing javascript from a different location (https://de.wikipedia.org/wiki/Same-Origin-Policy).
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Include perf graph in email notification

Post by rkennedy »

This will only work internally, and you'll need to include your username / ticket. If you open that link up in your browser does it return the expected graph? Are you looking at the graph internally?
Former Nagios Employee
IMTECH
Posts: 53
Joined: Fri Nov 25, 2011 6:35 am

Re: Include perf graph in email notification

Post by IMTECH »

Yes, its working if I try it in my browser.

The issue is, that it does not generate a simple graphic, but an website with the graph in it.
But also if it would just be a graphic that we can include in the mail using the <img>-tags we would have the issue that its not a snapshot of the time of alert.

What we try to achieve is, to have a graph embed in the alarm mail of the time of alarm like we see this in different monitoring applications.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Include perf graph in email notification

Post by rkennedy »

Ah, I understand. Just to make sure we're on the same page.

So, what you're looking for, is when the notification is sent, a static image of how the graph looks at that time - rather then a dynamically changing graph (as the iframes currently do).

Is that correct?
Former Nagios Employee
IMTECH
Posts: 53
Joined: Fri Nov 25, 2011 6:35 am

Re: Include perf graph in email notification

Post by IMTECH »

Sorry for the late answer - it seems I missed the mail notification of the reply ...

Yes, this would be exactly what we are looking for.
Locked