X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=examples%2F4charts.pl.in;h=a11b944185db50684b70ed918863d793f0346072;hp=f8304dd55d06a6cf7c9b9d56f7d22a41d7616e59;hb=ca8d9c109d76e8c024f21edd10474e0e5d29b892;hpb=5837606887a6d81e8b1f7588525cb1c8783fb62b diff --git a/examples/4charts.pl.in b/examples/4charts.pl.in index f8304dd..a11b944 100755 --- a/examples/4charts.pl.in +++ b/examples/4charts.pl.in @@ -1,14 +1,14 @@ #! @PERL@ #makes things work when run without install -use lib qw( ../libraries/perl-shared/blib/lib ../libraries/perl-shared/blib/arch ); -# this is for after install -use lib qw( @prefix@/lib/perl ../lib/perl ); +use lib qw( @prefix@/lib/perl ); + use RRDs; my $start=time; my $rrd="randome.rrd"; my $name = $0; +$name =~ s/.*\///g; $name =~ s/\.pl.*//g; RRDs::create ($rrd, "--start",$start-1, "--step",300, @@ -31,10 +31,11 @@ for ($t=$start; $t<$start+300*300; $t+=300){ } } -$c1="f57912"; -$c2="2a79e9"; -$w=300; -$h=140; +my $c1="f57912a0"; +my $c2="2a79e9a0"; +my $w=300; +my $h=140; + RRDs::graph "$name-L.png", "--title", "2 LINES", "--start", "now", @@ -115,12 +116,9 @@ RRDs::graph "$name-sample.png", "LINE1:b#ff0000:Max Incoming", ; - - -print "ERROR: $ERROR\n" if $ERROR = RRDs::error; - - - +if ($ERROR = RRDs::error) { + die "ERROR: $ERROR\n"; +}; print "This script has created $name.png in the current directory\n"; print "This demonstrates the use of the TIME and % RPN operators\n";