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 with
out 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.