From: "Roy" <roy@xxx.lt>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] tc & rrd question
Date: Fri, 30 Jul 2004 13:53:45 +0000 [thread overview]
Message-ID: <001501c4763c$a1ed1100$030aa8c0@t> (raw)
Basicaly it is easy to use rrd tool, the hardest part for me was to setup
rrd database correctly
here is example
RRDs::create("$rrd","-s",$period,
"DS:TR:GAUGE:300:0:U",
"RRA:AVERAGE:0.5:1:1440", # 0.5- uaualy leave as is : 1-
for first entry use 1 :1440 number of points
"RRA:AVERAGE:0.5:15:3072"); #: 0.5: 15 needs 15 updates to
create one average database entry :3072
Complete example for perl, probably will be good for you too. have
resolution of 1 min for 1 day and 15 min resolution for 1 month. uopdates
should be done each minute
$time=time;
$rrd="./data/$ip.rrd"; #$rrd is filename
if (!(-e "$rrd")) { print "creating $rrd\n";
RRDs::create("$rrd","-s",$period,
"DS:TR:GAUGE:300:0:U",
"RRA:AVERAGE:0.5:1:1440",
"RRA:AVERAGE:0.5:15:3072");
if (my $error=RRDs::error()) {print "Cannot create $rrd: $error\n";}
}
RRDs::update("$rrd","$time:$tr"); # $tr is the data you want to add to
database
if (my $error=RRDs::error()) {print "Cannot update $rrd: $error\n";}
}
##################
example for view script. shows load graph and total traffic per $period
$period is in seconds
$period600*24; #(for one day)
$start=time-$period; #starts from current time.
$rrd="./data/$ip.rrd";
RRDs::graph ("$cache/$name.png","--start=$start","--widthr0",
"DEF:d=$rrd:TR:AVERAGE",
"CDEF:down=d,UN,0,d,IF,$period,*",
"LINE1:d#6600cc",
"GPRINT:down:AVERAGE:%1.1lf%sB Download",
);
if (my $error=RRDs::error()) {print "Cannot graph $rrd: $error\n";}
print "<img src=\"$cache/$name.png\"> \n";
print "$name $ip<br>\n";
}
----- Original Message -----
From: <adi@tettas.net>
To: <lartc@mailman.ds9a.nl>
Sent: Friday, July 30, 2004 12:21 PM
Subject: [LARTC] tc & rrd question
> hello list,
> i've got a small question related to tc and rrd.
>
> my problem is as follows. i've written a small c app that takes the stats
> of tc using libs from iproute2 package and outputs a shell script that
> updates rrd files (2 ds: 1 gauge for speed, 1 counter for sent). i've
> followed the manuals from tobi's website on how to create and update the
> database. the dump is quite curious even after a hole day of updating
> (every 5 min).
>
> can anyone here share his/hers experience with these tools. any links or
> resources maybe even some example code are very welcome.
>
> thanks
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
reply other threads:[~2004-07-30 13:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001501c4763c$a1ed1100$030aa8c0@t' \
--to=roy@xxx.lt \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.