[rrd-users] Fetch a particular data source with rrdtool
Landon Stewart
lstewart at superb.net
Thu Jul 8 08:51:04 CEST 2010
Hi Sanjit,
I am successfully using the perl module RRDTool::OO for this purpose.
Something like the following would print values between the two time stamps
given on the command line as parameters:
#!/usr/bin/perl
use RRDTool::OO;
$rrd = RRDTool::OO->new( file => "rrdfile.rrd" );
$rrd->fetch_start(
start => @ARGV[0],
end => @ARGV[1],
resolution => "300",
cfunc => "MAX"
);
$rrd->fetch_skip_undef();
while(my($time, @value) = $rrd->fetch_next()) {
print "$time:",sprintf("%.2f", $value[0]),"\n" if $value[0];
print "$time:",sprintf("%.2f", $value[1]),"\n" if $value[1];
}
On Wed, Jul 7, 2010 at 8:44 PM, Sanjit Jhala <sjhalaz at gmail.com> wrote:
> I want to fetch the data for some specific statistics in the RRD and graph
> them with my own graphing tool instead of rrdgraph. Is it possible to fetch
> a particular statistic stored in the rrdtool database using something like
> rrdfetch?
>
> As I understand it rrdfetch fetches values for all the variables stored in
> RRD. Looking at rrdgraph it allows me to graph a specific stat without
> having to fetch values for all the stats. Is it possible to fetch just one
> or a specific set of statistics that I am interested in instead of all of
> them?
>
> -Sanjit
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20100707/e61add52/attachment-0001.htm
More information about the rrd-users
mailing list