Let's say we're collecting Data X from a device.
We want to compare this week's data with last's.
Is there a way within Cacti that we could setup a
graph to display both last week's and this week's
data on the same graph? Obviously in different
colors so that we can differentiate between them.
I'm not sure if this is even possible, or just going
to be complex to setup the first time. Any input?
Graph Data X over Two Time Ranges
Moderators: Developers, Moderators
Graph Data X over Two Time Ranges
http://www.TheHEMI.com/
Is the whole idea that graphs are from Time X to Time Y
and graphing multiple timeframes on a single graph is not
going to even be possible? Or is there a way to do this?
"Viewing the current and previous week together"
http://people.ee.ethz.ch/~oetiker/webto ... es.en.html
I see that RRDTool supports what I'm trying to come up
with, but I'm not sure if Cacti supports doing this or not?
and graphing multiple timeframes on a single graph is not
going to even be possible? Or is there a way to do this?
"Viewing the current and previous week together"
http://people.ee.ethz.ch/~oetiker/webto ... es.en.html
I see that RRDTool supports what I'm trying to come up
with, but I'm not sure if Cacti supports doing this or not?
http://www.TheHEMI.com/
I'm no expert...
I'm not sure of the correct way to do this, but I know one way.
there's a command-line tool to rrdtool. use rrdtool dump <name of rrdfile> to get an xml output of all the data in the RRD. You can grep for the line from exactly one week ago. Then create a shell script to put that data wherever you want.
I'm sure this is a completely brute-force way to get past data and there's probably something much easier.
Also, if you have a lot of disk space and don't mind setting your RRAs to retain more data than normal you can keep fine granularity for two weeks. From there I bet there's a way to plot this weeks chart and last weeks chart on the same graph.
Good luck to you. Let us all know what you find.
-Terry
there's a command-line tool to rrdtool. use rrdtool dump <name of rrdfile> to get an xml output of all the data in the RRD. You can grep for the line from exactly one week ago. Then create a shell script to put that data wherever you want.
I'm sure this is a completely brute-force way to get past data and there's probably something much easier.
Also, if you have a lot of disk space and don't mind setting your RRAs to retain more data than normal you can keep fine granularity for two weeks. From there I bet there's a way to plot this weeks chart and last weeks chart on the same graph.
Good luck to you. Let us all know what you find.
-Terry
I'm using RRDtool manually to attempt to get this to work,
and then I am going to see how I incorporate it into Cacti.
I can get the graph to show 1 week and legend 2 weeks.
So I have RRDtool actually pulling out the proper dataset.
But I cannot get them to graph on a single week's graph.
I have to expand to a 2 week graph to get both the weeks.
The idea is I want them on top of each other to compare.
I guess this is really a question for RRDtool folks actually.
and then I am going to see how I incorporate it into Cacti.
I can get the graph to show 1 week and legend 2 weeks.
So I have RRDtool actually pulling out the proper dataset.
But I cannot get them to graph on a single week's graph.
I have to expand to a 2 week graph to get both the weeks.
The idea is I want them on top of each other to compare.
I guess this is really a question for RRDtool folks actually.
http://www.TheHEMI.com/
--end=now --start=end-1w
DEF:a="cpu.rrd":cpu:AVERAGE:end=now:start=now-1w
DEF:b="cpu.rrd":cpu:AVERAGE:end=now-1w:start=end-1w
SHIFT604800
--end/start are obviously included in Cacti by default.
Under the DEFs, in Cacti the end/start are not shown,
so I assume rrdtool defaults with the --end/start data.
If only there was a way to adjust the end/start on one
of the DEFs and add the SHIFT parameter, Cacti could
support graphing now vs old. That would be real cool.
I guess I will figure out how to put in a feature request.
DEF:a="cpu.rrd":cpu:AVERAGE:end=now:start=now-1w
DEF:b="cpu.rrd":cpu:AVERAGE:end=now-1w:start=end-1w
SHIFT604800
--end/start are obviously included in Cacti by default.
Under the DEFs, in Cacti the end/start are not shown,
so I assume rrdtool defaults with the --end/start data.
If only there was a way to adjust the end/start on one
of the DEFs and add the SHIFT parameter, Cacti could
support graphing now vs old. That would be real cool.
I guess I will figure out how to put in a feature request.
http://www.TheHEMI.com/
-
- Posts: 28
- Joined: Mon Sep 21, 2009 9:31 am
Re: Graph Data X over Two Time Ranges
Yes this is over 10yrs old.
But did anyone ever figure out a way to graph this without running rrdtool via a script to get the data from a week ago?
But did anyone ever figure out a way to graph this without running rrdtool via a script to get the data from a week ago?
Who is online
Users browsing this forum: No registered users and 0 guests