
RRDTool::Rawish - A RRDtool wrapper with rawish interface

use RRDTool::Rawish;
my $rrd = RRDTool::Rawish->new(
rrdfile => 'rrdtest.rrd', # option
remote => 'rrdtest.com:11111', # option for rrdcached
);
my $exit_status = $rrd->create(["DS:rx:DERIVE:40:0:U", "DS:tx:DERIVE:40:0:U", "RRA:LAST:0.5:1:240"], {
'--start' => '1350294000',
'--step' => '20',
'--no-overwrite' => '1',
});
my $exit_status = $rrd->update([
"1350294020:0:0",
"1350294040:50:100",
"1350294060:80:150",
"1350294080:100:200",
"1350294100:180:300",
"1350294120:220:380",
"1350294140:270:400"
]);
my $img = $rrd->graph([
"DEF:rx=rrdtest2.rrd:rx:LAST",
"DEF:tx=rrdtest2.rrd:tx:LAST",
"LINE1:rx:rx#00F000",
"LINE1:tx#0000F0",
]);
# error message
$rrd->errstr; # => "ERROR: hogehoge"

RRDTool::Rawish is a RRDtool wrapper class with rawish interface. You can use the class like RRDtool command interface. And RRDTool::Rawish has less dependencies and it is easy to install it.

Creates a new instance of RRDTool::Rawish.
rrdtool create
rrdtool update
rrdtool graph Returns image binary.
rrdtool dump Returns xml data.
rrdtool restore Returns exit status
rrdtool lastupdate Returns timestamp
rrdtool fetch Returns output lines as an ARRAY refarence
rrdtool xport Returns xml data
rrdtool info Returns info as a HASH refarence
Examples: is $value->{filename}, "rrd_test.rrd"; is $value->{rrd_version}, "0003"; is $value->{step}, 20; is $value->{last_update}, 1350294000; is $value->{header_size}, 904; is $value->{ds}->{rx}->{index}, 0; is $value->{ds}->{rx}->{minimal_heartbeat}, 40; is $value->{ds}->{rx}->{min}, "0.0000000000e+00"; is $value->{ds}->{rx}->{max}, "NaN"; is $value->{ds}->{rx}->{last_ds}, "U"; is $value->{ds}->{rx}->{value}, "0.0000000000e+00"; is $value->{ds}->{rx}->{unknown_sec}, 0; is $value->{ds}->{tx}->{index}, 1; is $value->{ds}->{tx}->{type}, "DERIVE"; is $value->{ds}->{tx}->{minimal_heartbeat}, 40; is $value->{ds}->{tx}->{min}, "0.0000000000e+00"; is $value->{ds}->{tx}->{max}, "NaN"; is $value->{ds}->{tx}->{last_ds}, "U"; is $value->{ds}->{tx}->{value}, "0.0000000000e+00"; is $value->{ds}->{tx}->{unknown_sec}, 0; is $value->{rra}->[0]->{cf}, "LAST"; is $value->{rra}->[0]->{rows}, 240; is $value->{rra}->[0]->{cur_row}, 95; is $value->{rra}->[0]->{pdp_per_row}, 1; is $value->{rra}->[0]->{xff}, "5.0000000000e-01"; is $value->{rra}->[0]->{cdp_prep}->[0]->{value}, "NaN"; is $value->{rra}->[0]->{cdp_prep}->[0]->{unknown_datapoints}, 0; is $value->{rra}->[0]->{cdp_prep}->[1]->{value}, "NaN"; is $value->{rra}->[0]->{cdp_prep}->[1]->{unknown_datapoints}, 0;

Yuuki Tsubouchi <yuuki@cpan.org>

Shoichi Masuhara


Copyright (c) 2013, Yuuki Tsubouchi <yuuki@cpan.org>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.