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?
Manipulating trend charts
-
- Posts: 316
- Joined: Thu Mar 31, 2011 9:54 am
- Location: Patten, ME
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: Manipulating trend charts
It surely is possiblecwscribner wrote:I'm not sure this is possible

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: 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.
The change would likely be made in:cwscribner wrote: So with that info, I guess my question is whether or not you can add/change the default chart views in Nagios?
/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
-
- Posts: 316
- Joined: Thu Mar 31, 2011 9:54 am
- Location: Patten, ME
Re: Manipulating trend charts
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.
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.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: Manipulating trend charts
make a backup of graphApi.php just in case, and then try the following:
on about line 169, change
to this
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) );
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) );
-
- Posts: 316
- Joined: Thu Mar 31, 2011 9:54 am
- Location: Patten, ME
Re: Manipulating trend charts
That was the first thing I tried. I attempted it again just in case but the graphs still default to a 4h view.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: Manipulating trend charts
Looking at this again, this was a bad idea...
$view=5;
made every graph a 30 minute graph on my test system...
$view=5;
made every graph a 30 minute graph on my test system...
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.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.
-
- Posts: 316
- Joined: Thu Mar 31, 2011 9:54 am
- Location: Patten, ME
Re: Manipulating trend charts
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.
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.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: Manipulating trend charts
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)
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)
-
- Posts: 316
- Joined: Thu Mar 31, 2011 9:54 am
- Location: Patten, ME
Re: Manipulating trend charts
So I have a problem...none of the charts are showing up...
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: Manipulating trend charts
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.