Question: Are you able to specify a time range for a graph?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia

Question: Are you able to specify a time range for a graph?

Post by Box293 »

Looking at this screenshot
Performance graph When Date Selected.jpg
I've used the calendar icon to select a specific date to display historical data for, this can be seen highlighted.

Question 1)
Is there a way to specify a time period as well as the date?

Question 2)
Is there a way to specify a time period that spans multiple dates?


Thanks
Troy
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Question: Are you able to specify a time range for a graph?

Post by mmestnik »

There should be, most RRD graphing tools allow arbitrary start/stop/granularity to be specified. We use PNP as a backend graphing tool and once you get the URLs you want you can add them to custom dashlets.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia

Re: Question: Are you able to specify a time range for a graph?

Post by Box293 »

I have a co-worker asking me to display a performance graph from two days ago between 7am - 11am.

How would I do this using the Nagios XI interface?

It lets me select a specific date
This then shows the date and time period above the graph (see screenshot in original post).
The time period is 20:00:00 - 00:00:00
How do I customize this time period to be 07:00:00 - 11:00:00?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Question: Are you able to specify a time range for a graph?

Post by mmestnik »

The best I can do is direct you to the PNP documentation.
http://docs.pnp4nagios.org/pnp-0.4/timeranges
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia

Re: Question: Are you able to specify a time range for a graph?

Post by Box293 »

The link you provided has some information that looks like it's easy to manipulate the URL's however if you try the example it doesn't work.
Additionally you can influence the end of the timeranges via the URL. This can be useful to automatically create PDF documents. The ranges can be defined using the option “end”.

Example:

Code: Select all

http://<Nagios host>/pnp/index.php?host=<hostname>&srv=<servicedesc>&end=-1week
All examples are reproducible using the localhost ping service.

To use the example without the &end=-1week would give me:
http://<Nagios host>/nagiosxi/perfgraphs/index.php?&host=localhost&srv=PING
Example1.PNG
To use the example with the &end=-1week would give me:
http://<Nagios host>/nagiosxi/perfgraphs/index.php?&host=localhost&srv=PING&end=-1week
Example2.PNG
1969 / 1970 ... what the ???

I was showing this to a collegue and showed him the graph for the past 24 hours for the date 2010-05-26. The URL is:

http://<Nagios host>/nagiosxi/perfgraphs/index.php?&host=localhost&service=PING&source=1&view=1&start=&end=&mode=2&service_id=86&end=1274882400

I had been playing around with the number 1274882400 and had already worked out that 86400 is the amount of seconds in a 24 hour period. I had also understood that &view= changes between 4 Hour / 24 Hour / Week / Month / Year.

He pointed out that 1274882400 is probably the amount of seconds that has past since the Unix Epoch date, this being January 1, 1970.

He is correct. For the 24 hour view for the date 2010-05-26 the amount of seconds is 1274882400.

With the numbers below I need to take into account my timezone GMT+10.

So to answer my original question:
Fri Apr 16, 2010 wrote:I have a co-worker asking me to display a performance graph from two days ago between 7am - 11am.

How would I do this using the Nagios XI interface?
2010-04-14 07:00:00 = 1271192400
2010-04-14 11:00:00 = 1271206800

The custom URL would be:
http://<Nagios host>/nagiosxi/perfgraphs/index.php?&host=localhost&srv=PING&start=1271192400&end=1271206800

And it shows the graph for the time period 7am - 11am.

Although I might note that the graph is saying that it is for the period 2010-04-13 11:00:00 to 2010-04-14 11:00:00 but I suspect this has something to with the built in views (however the URL does not have the view specified).
Example3.PNG
Question:
Why does the implementation of PNP in Nagios XI operate differently to the examples on the PNP documentation site?

The PNP documentation does not even explain the use of epoch values.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Question: Are you able to specify a time range for a graph?

Post by mmestnik »

The answer to your question is that NagiosXI sends your browser an image URI that then hits a NagiosXI php script that sends an HTTP client request to Apache to fetch the data from PNP.

You can discover the URLs the graphs are located at by looking at the access_log, requests from 127.0.0.1. I'd wager PNP is loaded at /nagios/pnp and not /pnp, or /nagiosxi/pnp.

http://go.nagios.com/tracker/56
User avatar
admin
Site Admin
Posts: 256
Joined: Mon Oct 12, 2009 8:21 am

Re: Question: Are you able to specify a time range for a graph?

Post by admin »

Nagios XI only uses the backend portion of PNP to generate the RRD graphs. The XI interface for performance graphs is completely rebuilt and while similar to, different than PNP. While there is currently no nice UI to include custom dates/times, you can pass UNIX epoch timestamps in the start and end query parameters to get the graph you want.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Ethan Galstad
President