3 use lib qw( @prefix@/lib/perl );
11 RRDs::create ($rrd, "--start",$start-1, "--step",300,
13 "RRA:AVERAGE:0.5:1:300",
17 my $ERROR = RRDs::error;
18 die "$0: unable to create `$rrd': $ERROR\n" if $ERROR;
20 # dropt some data into the rrd
22 for ($t=$start; $t<$start+300*300; $t+=300){
23 RRDs::update $rrd, "$t:".(sin($t/3000)*50+50);
24 if ($ERROR = RRDs::error) {
25 die "$0: unable to update `$rrd': $ERROR\n";
29 RRDs::graph "$name.png",
30 "--title", uc($name)." Demo",
37 "DEF:a=$rrd:a:AVERAGE",
45 if ($ERROR = RRDs::error) {
46 print "ERROR: $ERROR\n";
50 print "This script has created $name.png in the current directory\n";
51 print "This demonstrates the use of the TIME and % RPN operators\n";