Page 1 of 1
Working code for Performance Graphs Specific Time Selection
Posted: Wed Jan 12, 2011 7:51 am
by Box293
After much learning I've adjusted

some code that allows for time selection in the perfgraphs sidebar.
It's still a little buggy, some things I would like to resolve:
- After viewing a specific time period, the select boxes no longer update when I click the predefined time selections
Prettier Year / Month / Day selector, preferably a drop down calendar
There is no code that determines if the start date is before the end date and vice versa
Here's a screenshot of it in action:
Specific Time Selection In Action.png
I'm also curious if it possible to make this into a component that could be added to Nagios XI.
Thoughts / comments / suggestions ???
The attached file is the customised index.php from /usr/local/nagiosxi/html/perfgraphs
index.zip
Re: Working code for Performance Graphs Specific Time Selection
Posted: Wed Jan 12, 2011 10:27 am
by mguthrie
Very cool!
I'll put this on my TODO list and take a look at the code. Adding a sleeker calendar and the fixes you mentioned shouldn't be too hard. I think having it as an installable component is a great idea as well. Thanks for the work on this!
Re: Working code for Performance Graphs Specific Time Selection
Posted: Wed Jan 12, 2011 11:21 am
by admin
Actually, in the latest code this is already possible. It will be included in the 2009R1.4 release shortly.
The end date can include hours, minutes seconds like so:
2011-01-01 13:14:23
The start date/time is automatically calculated based on 1) the end date and 2) the time selection (4 hour, 24 hour, etc)
Re: Working code for Performance Graphs Specific Time Selection
Posted: Wed Jan 12, 2011 7:39 pm
by Box293
Cheers.
I'll download the latest code on a test VM and check it out.
Re: Working code for Performance Graphs Specific Time Selection
Posted: Thu Jan 13, 2011 10:16 am
by rdedon
Thank you and keep us up to date

Re: Working code for Performance Graphs Specific Time Selection
Posted: Sat Jan 15, 2011 11:29 pm
by Box293
I've had a play with the latest code and to be honest it doesn't give me the functionality I am after.
While the latest code allows me to specify the end date and time, I am still locked in to the pre-defined time selections available to me.
Being able to dial into a specific time period is what I am acheiving with the code I have supplied.
Some examples of why:
- Reporting issues to service providers, I want to show them a time period less than four hours
I make a change to a server that will affect it's performance. One week later I want to view the past two weeks so I can compare the week before the change and the week after the change
I do like the predetermined time selections already available as they offer access to quick graphs but there are many times when I need to be able to select the time period I am after.
Perhaps being able to add this functionality as a component allows for customisations that suit different needs.
Re: Working code for Performance Graphs Specific Time Selection
Posted: Mon Jan 17, 2011 11:05 am
by mguthrie
I'll keep it on my TODO list to turn what you have into a component. I'm guessing you won't be the only user who would prefer more advanced options.
Re: Working code for Performance Graphs Specific Time Selection
Posted: Mon Jan 17, 2011 5:47 pm
by Box293
Cool bananas.
Let me know if there is anything you need me to do.
Re: Working code for Performance Graphs Specific Time Selection
Posted: Wed Jan 19, 2011 9:53 am
by rdedon
Thanks again
