Graph Data X over Two Time Ranges

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
thehemi
Posts: 32
Joined: Wed Jul 27, 2005 3:11 pm
Location: Texas

Graph Data X over Two Time Ranges

Post by thehemi »

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?
http://www.TheHEMI.com/
thehemi
Posts: 32
Joined: Wed Jul 27, 2005 3:11 pm
Location: Texas

Post by thehemi »

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?
http://www.TheHEMI.com/
tpe
Posts: 12
Joined: Tue Jul 26, 2005 1:08 pm

I'm no expert...

Post by tpe »

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
thehemi
Posts: 32
Joined: Wed Jul 27, 2005 3:11 pm
Location: Texas

Post by thehemi »

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.
http://www.TheHEMI.com/
thehemi
Posts: 32
Joined: Wed Jul 27, 2005 3:11 pm
Location: Texas

Post by thehemi »

--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
SHIFT:b:604800

--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/
tpe
Posts: 12
Joined: Tue Jul 26, 2005 1:08 pm

Post by tpe »

Can you work around this in the meantime by going in after Cacti creates the RRD. deleting it and creating it manually as you want?
mstbone67a
Posts: 28
Joined: Mon Sep 21, 2009 9:31 am

Re: Graph Data X over Two Time Ranges

Post by mstbone67a »

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?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests