Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[rrd-users] Re: Newbie: "step" confusion, blank plots

0 views
Skip to first unread message

Mike Hunter

unread,
Oct 2, 2003, 2:27:13 PM10/2/03
to
On Sep 25, "To rrd-...@list.ee.ethz.ch" wrote:

Since I didn't get any hits on my initial email, let me try rephrasing my
problem into something simpler.

Can somebody show me how to make an rrdgraph out of the following
datafile?

2003-08-29.013001 10920070747 8291601450
2003-08-29.014501 9914236068 9615483756
2003-08-29.020001 8202305396 7795379166
2003-08-29.021501 7450926286 7995740622
2003-08-29.023001 7100548682 7943914961
2003-08-29.024501 7928561712 8222909469
2003-08-29.030001 5779334162 7954788420
2003-08-29.031501 5404870464 8294500672
2003-08-29.033001 4751317213 6861155522
2003-08-29.034501 5624335005 8089450973
2003-08-29.040001 2908052123 5655948510
2003-08-29.041501 5171003056 8099823516
2003-08-29.043001 4059829955 7416167984
2003-08-29.044501 4467995422 8396832232
2003-08-29.050001 3498427949 7258680374
2003-08-29.051501 4523794735 8226483341
2003-08-29.053001 3161418542 7720306661
2003-08-29.054501 3093824420 7140138469
...

I hate morons who don't read the man page too, but I've tried and I can't
figure this out :|

The code to convert the dates to epoch seconds is as follows:

...
my ($datemess, $in, $out) = split /\s+/, $_;
my ($year, $month, $day, $timemess) = split /[-.]/, $datemess;
my $hour = substr $timemess, 0, 2;
my $minute = substr $timemess, 2, 2;
my $second = substr $timemess, 4, 2;
$hour =~ s/^0*(.)/$1/;
$minute =~ s/^0*(.)/$1/;
$second =~ s/^0*(.)/$1/;
my $epoch_cmd = "date -j -v".$year."y -v".$month."m -v".$day."d -v".
$hour."H -v".$minute."M -v".$second."S \"+%s\"";
$debug and print $epoch_cmd;
my $epoch = `$epoch_cmd`;
...

Thanks,

Mike

--
Unsubscribe mailto:rrd-user...@list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-user...@list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi

Mike Hunter

unread,
Oct 2, 2003, 8:21:16 PM10/2/03
to
On Oct 02, "Serge Maandag" wrote:

> rrdtool will only graph data coming out of a rrd database.
> Therefore you must first put it in one.

Right.

> You do that by creating one and updating it with your data.
> Since your data is sampled with a 15 minute interval, you can take that for stepsize.
> Put 2 DS's in it with a heartbeat of more than 15 minutes, say 30 minutes.
>
> Add at least one RRA to hold your data.
> Below you have 18 samples, if that is all you would add an RRA with an xff of 0.5, that has 18 samples, each consolidated from 1 sample.
>
> rrdtool create blabla.rrd --start <timestamp of first sample> \
> --step 900 \
> DS:ds0:DST:1800:U:U \
> DS:ds1:DST:1800:U:U \
> RRA:AVERAGE:0.5:1:18
>
> Where DST should be replaced by GAUGE, COUNTER or whatever, depending on your data.
>
> Then insert your data by doing:
>
> rrdtool update blabla.rrd -t ds0:ds1 $epoch:$in:$out $epoch2:$in2:$out2 ..... etc...
>
> Now you can do rrdtool graph on the rrd.

Thanks very much for your reply. I'm still having problems with the
graph. I put the exact commands I typed in, the data file, and the output
image here:

http://ack.berkeley.edu/~mhunter/rrdtool

Why is the data squiggle so small, especially since I explicitly
(correctly?) set the start and end times?

Thanks again for your help,

ua...@alumni.uv.es

unread,
Oct 3, 2003, 2:51:17 AM10/3/03
to

Hello Mike

I'm a newbie too, I'will try to answer

On Thu, Oct 02, 2003 at 11:26:04AM -0700, Mike Hunter wrote:
> On Sep 25, "To rrd-...@list.ee.ethz.ch" wrote:
>

[...]


> Can somebody show me how to make an rrdgraph out of the following
> datafile?
>
> 2003-08-29.013001 10920070747 8291601450
> 2003-08-29.014501 9914236068 9615483756
> 2003-08-29.020001 8202305396 7795379166
> 2003-08-29.021501 7450926286 7995740622
> 2003-08-29.023001 7100548682 7943914961
> 2003-08-29.024501 7928561712 8222909469
> 2003-08-29.030001 5779334162 7954788420
> 2003-08-29.031501 5404870464 8294500672
> 2003-08-29.033001 4751317213 6861155522
> 2003-08-29.034501 5624335005 8089450973
> 2003-08-29.040001 2908052123 5655948510
> 2003-08-29.041501 5171003056 8099823516
> 2003-08-29.043001 4059829955 7416167984
> 2003-08-29.044501 4467995422 8396832232
> 2003-08-29.050001 3498427949 7258680374
> 2003-08-29.051501 4523794735 8226483341
> 2003-08-29.053001 3161418542 7720306661
> 2003-08-29.054501 3093824420 7140138469
> ...

the timestamp can be specified along with "rrdtool update"
the other two columns must be declared at database creation as two
DataSources (DS)

I suggest you to read, a reply to a previous question I made

http://www.ee.ethz.ch/~slist/rrd-users/msg07398.html

I hope this helps

Ulisses


>
> I hate morons who don't read the man page too, but I've tried and I can't
> figure this out :|
>
> The code to convert the dates to epoch seconds is as follows:

Is this the problem?

debug it line by line :-)

Ulisses

>
> ...
> my ($datemess, $in, $out) = split /\s+/, $_;
> my ($year, $month, $day, $timemess) = split /[-.]/, $datemess;
> my $hour = substr $timemess, 0, 2;
> my $minute = substr $timemess, 2, 2;
> my $second = substr $timemess, 4, 2;
> $hour =~ s/^0*(.)/$1/;
> $minute =~ s/^0*(.)/$1/;
> $second =~ s/^0*(.)/$1/;
> my $epoch_cmd = "date -j -v".$year."y -v".$month."m -v".$day."d -v".
> $hour."H -v".$minute."M -v".$second."S \"+%s\"";
> $debug and print $epoch_cmd;
> my $epoch = `$epoch_cmd`;
>
>
> ...
>
> Thanks,
>

> Mike
>
> --
> Unsubscribe mailto:rrd-user...@list.ee.ethz.ch?subject=unsubscribe
> Help mailto:rrd-user...@list.ee.ethz.ch?subject=help
> Archive http://www.ee.ethz.ch/~slist/rrd-users
> WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
>

--
Debian GNU/Linux: a dream come true
-----------------------------------------------------------------------------
"Computers are useless. They can only give answers." Pablo Picasso

---> Visita http://www.valux.org/ para saber acerca de la <---
---> Asociación Valenciana de Usuarios de Linux <---

Alex van den Bogaerdt

unread,
Oct 3, 2003, 4:37:35 AM10/3/03
to
On Thu, Oct 02, 2003 at 05:19:11PM -0700, Mike Hunter wrote:
> Thanks very much for your reply. I'm still having problems with the
> graph. I put the exact commands I typed in, the data file, and the output
> image here:
>
> http://ack.berkeley.edu/~mhunter/rrdtool
>
> Why is the data squiggle so small, especially since I explicitly
> (correctly?) set the start and end times?

What do you mean: small ?

I don't think 10 giga<whatever> is small. This is 10 * 1000 * 1000 * 1000
you know


HTH
Alex

Serge Maandag

unread,
Oct 3, 2003, 7:32:51 AM10/3/03
to
Because you defined this RRA:

RRA:AVERAGE:0.5:1:18

Which will only hold the last 18 samples. It was adequate for the
example you gave earlier on, but if you want to graph a full week, you
must think more in the lines of:

1 week = 7 days = 7*24 hours = 7*24*3600 secs = 311040000 secs.
Sample time = 900 secs

No of rows to keep = 311040000/900 = 345600 rows
That would make:
RRA:AVERAGE:0.5:1:345600

That are a lot of rows. Only useful if you are generating graphs 345600
pixels wide.
I would consolidate more than 1 primary point into a consolidated point
(=row).

Say your graph will be 600 pixels wide. Then 600 rows will be enough.
So take the average of 345600/600 = 576 primary datapoints per row:
RRA:AVERAGE:0.5:576:600

Serge.


Thanks very much for your reply. I'm still having problems with the
graph. I put the exact commands I typed in, the data file, and the
output
image here:

http://ack.berkeley.edu/~mhunter/rrdtool

Why is the data squiggle so small, especially since I explicitly
(correctly?) set the start and end times?

Thanks again for your help,

Mike

--

Mike Hunter

unread,
Oct 6, 2003, 4:18:50 PM10/6/03
to
On Oct 03, "Serge Maandag" wrote:

> Because you defined this RRA:
> RRA:AVERAGE:0.5:1:18
>
> Which will only hold the last 18 samples. It was adequate for the
> example you gave earlier on, but if you want to graph a full week, you
> must think more in the lines of:
>
> 1 week = 7 days = 7*24 hours = 7*24*3600 secs = 311040000 secs.
> Sample time = 900 secs
>
> No of rows to keep = 311040000/900 = 345600 rows
> That would make:
> RRA:AVERAGE:0.5:1:345600
>
> That are a lot of rows. Only useful if you are generating graphs 345600
> pixels wide.
> I would consolidate more than 1 primary point into a consolidated point
> (=row).
>
> Say your graph will be 600 pixels wide. Then 600 rows will be enough.
> So take the average of 345600/600 = 576 primary datapoints per row:
> RRA:AVERAGE:0.5:576:600

I get it. Thanks very much. I have it working well.

Alex van den Bogaerdt

unread,
Oct 6, 2003, 5:29:57 PM10/6/03
to
On Mon, Oct 06, 2003 at 01:16:48PM -0700, Mike Hunter wrote:
> On Oct 03, "Serge Maandag" wrote:
Uhm... must have missed the original reply.

> > No of rows to keep = 311040000/900 = 345600 rows
> > That would make:
> > RRA:AVERAGE:0.5:1:345600
> >
> > That are a lot of rows. Only useful if you are generating graphs 345600
> > pixels wide.

This is also useful if one wants to generate graphs many moons ago
in a high resolution.

I'm talking "--end 20030601 --start end-1week" here.

cheers,
Alex
--
http://www.googlism.com/index.htm?ism=alex+van+den+bogaerdt&type=1

0 new messages