Manipulating trend charts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
cwscribner
Posts: 316
Joined: Thu Mar 31, 2011 9:54 am
Location: Patten, ME

Manipulating trend charts

Post by cwscribner »

Hi all.

I'm not sure this is possible given Nagios' built-in defaults but I wanted to ask anyway. My client is looking to have the Nagios charts comparable to charts generated by Xymon. Xymon shows a 30 minute chart with 5 minute sampling that steadily rolls forward throughout the day.

So with that info, I guess my question is whether or not you can add/change the default chart views in Nagios?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Manipulating trend charts

Post by scottwilkerson »

cwscribner wrote:I'm not sure this is possible
It surely is possible ;)
cwscribner wrote: My client is looking to have the Nagios charts comparable to charts generated by Xymon. Xymon shows a 30 minute chart with 5 minute sampling that steadily rolls forward throughout the day.
I'm not exactly sure how you would want the chart laid out. I did a quick look at Xymon and it is using RRD so it certainly should be possible.
cwscribner wrote: So with that info, I guess my question is whether or not you can add/change the default chart views in Nagios?
The change would likely be made in:
/usr/local/nagiosxi/html/includes/components/perfdata/graphApi.php
or
/usr/local/nagiosxi/html/includes/components/perfdata/perfdata.inc.php

with possible modifications to:
/usr/local/nagios/share/pnp/templates.dist/response.php
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
cwscribner
Posts: 316
Joined: Thu Mar 31, 2011 9:54 am
Location: Patten, ME

Re: Manipulating trend charts

Post by cwscribner »

I want to have the regular chart width and length, but instead of seeing a 4 hour spread of data, I just want 30 minutes. I'm looking to make it the default so the client doesn't have to repetitively query for that time frame.

I looked in the graphAPI but couldn't find anything explicit regarding default times. I saw a function at the very bottom defining time frames so I tried modifying that, but still no luck.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Manipulating trend charts

Post by scottwilkerson »

make a backup of graphApi.php just in case, and then try the following:

on about line 169, change

Code: Select all

$pnpviews = array('-4h', '-24h', '-7d', '-30d','-365d'); 
//timestamp conversions for PNP views 
$pnpstamps = array((60*60*4), (60*60*24), (60*60*24*7), (60*60*24*30), (60*60*24*365) ); 
to this

Code: Select all

$view=5;
$pnpviews = array('-4h', '-24h', '-7d', '-30d','-365d', '-30m'); 
//timestamp conversions for PNP views 
$pnpstamps = array((60*60*4), (60*60*24), (60*60*24*7), (60*60*24*30), (60*60*24*365), (60*30) ); 
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
cwscribner
Posts: 316
Joined: Thu Mar 31, 2011 9:54 am
Location: Patten, ME

Re: Manipulating trend charts

Post by cwscribner »

That was the first thing I tried. I attempted it again just in case but the graphs still default to a 4h view.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Manipulating trend charts

Post by scottwilkerson »

Looking at this again, this was a bad idea...

$view=5;

made every graph a 30 minute graph on my test system...
cwscribner wrote:That was the first thing I tried. I attempted it again just in case but the graphs still default to a 4h view.
I guess I need to know which graphs you are looking at as well as what version of XI you are running, and if you have any special configuration.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
cwscribner
Posts: 316
Joined: Thu Mar 31, 2011 9:54 am
Location: Patten, ME

Re: Manipulating trend charts

Post by cwscribner »

I want to be able to set a graph (any and all graphs) to a 30 minute time frame, and add it to a dashboard and maintain that 30 minute time frame by auto-updating every so often. The update interval isn't important as long as its not more than 30m...obviously.

I'm on Xi 2011R1.9

I don't have any special configuration in terms of the interface. I have Nagvis installed if that matters. I haven't made any changes to RRD or any graphing mechanisms.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Manipulating trend charts

Post by scottwilkerson »

This is weird that they default to a 4h view, my clean install defaults to a 24h view.

If you use firefox, can you right click on a graph and choose "Copy Image Location" and post it here (obfuscate the domain if necessary)
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
cwscribner
Posts: 316
Joined: Thu Mar 31, 2011 9:54 am
Location: Patten, ME

Re: Manipulating trend charts

Post by cwscribner »

So I have a problem...none of the charts are showing up...
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Manipulating trend charts

Post by scottwilkerson »

If it is from mods to the perfdata component, you can upload this through Admin -> manage components to restore defaults.
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart