[rrd-users] No graphic line's show up

Sjaak Nabuurs sjaak at vsm-hosting.nl
Fri Apr 25 16:18:23 MEST 2003

Hi all

I'm just new and read the man pages but English isn't my main language so
maybe I'm missing something

I modify the example file run this script in a 5 min cron
 and the strange thing is that the for next loop work nicely.
if I put data into the http_mrtg.rrd it works great.
When i look into the database with rrdtool dump i see a lot of figures and
this looks real good
But no way i can get a nice graph.
I'm getting @##@^^#@^@!

What could be wrong ?
I guess somthing wrong with timing

#! /usr/bin/perl

#makes things work when run without install
use lib qw( ../perl-shared/blib/lib ../perl-shared/blib/arch );
# this is for after install
use lib qw( /usr/local/rrdtool/lib/perl ../lib/perl );
use RRDs;
use strict;
my $start=time;
my $rrd="/usr/local/rrdtool/examples/http_mrtg.rrd";
my $name = $0;
$name =~ s/\.pl.*//g;
my $file = "/usr/local/rrdtool/examples/http_mrg.data";
my @tmp="";
my $teller = 0 ;
my $ERROR = "";
my $gelezen = "";
my @waardes="";
my $pngfile = "/var/www/html/http.png";
my $t;

my $makedb ="no";

if ($makedb eq "yes") {
        RRDs::create ($rrd, "--start",$start-1, "--step",300,
my $ERROR = RRDs::error;
die "$0: unable to create `$rrd': $ERROR\n" if $ERROR;

# grep the http data from iptables and do other stuff

# read the data file (just grepped) and drop data into the rrd

foreach $gelezen(@waardes)
# chomp($gelezen);
        $tmp[$teller] =  $gelezen;
        RRDs::update $rrd, "$start:".($tmp[0]). ":".($tmp[1]).
":".($tmp[2]). ":".($tmp[3]).":".($tmp[4]). ":".($tmp[5]);
         if ($ERROR = RRDs::error) {
           die "$0: unable to update `$rrd': $ERROR\n";
# the database dump  with rrdtool dump look's okay

# generate example in a FORNEXT LOOP This works fine showed a nice graph
#     for ($t=$start; $t<$start+300*300; $t+=300){
# RRDs::update $rrd, "$t:".(sin($t/3000)*50+70). " $t:".(sin($t/100)*50+30).
" $t:".(sin($t/3000)*30+300).
" $t:".(sin($t/3000)*50+10). " $t:".(sin($t/200)*50+10). "
#     if ($ERROR = RRDs::error) {
#        die "$0: unable to update `$rrd': $ERROR\n";
#      }
#     }

RRDs::graph "$pngfile",
  "--title", "HTTP data transfer, loadbalancing router VSM.",
  "--vertical-label", "Waardes in Mbits",
  "--start", "now",
  "--end", "start+1d",

if ($ERROR = RRDs::error) {
  print "ERROR: $ERROR\n";

Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list