[rrd-users] Re: rrdtool empty graphs

mrugan mrugan at softhome.net
Fri Mar 19 00:49:52 MET 2004


RS> Hello!
RS> I am trying to create some rrds from data taken with some scripts.
RS> It seems the problem is only happening here. i am running debian unstable with
RS> rrdtool 1.0.46-2 .
RS> for example
RS> --
RS> if test ! -e misc/loadavg.rrd; then
RS>                 /usr/bin/rrdtool create misc/loadavg.rrd --step 300
RS> DS:load_1min:GAUGE:600:0:500 DS:load_5min:GAUGE:600:0:500 
RS> DS:load_15min:GAUGE:600:0:500 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700
RS> RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MAX:0.5:1:600 
RS> RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
RS> fi
RS>   /usr/bin/rrdtool update misc/loadavg.rrd $(uptime | sed -r 's/.*: ([0-9.]*),
RS> ([0-9.]*), ([0-9.]*)/N:\1:\2:\3/')
RS> ---
RS> However the rrd's are empty.
RS> Initialy i ran into this problem with flowscan, i though it was flowscan's
RS> fault however i can't be since this script has the same problems.
RS> These are not my scripts, however they run on other boxes.
RS> Radu Spineanu

Salutari Radu :)

consider to do ur best to use Perl(::RRDs);
sometimes the command line utillities can become traps as in \s (white
spaces) and so on ...
and u don't have the tool to check the typeof variable u work with
unless u write one. ... but that's a pain.

so here is it ... written in a hurry ... u could make some improvments
... major ones ...

#!/usr/bin/perl -w

@intervals =("1min","5min","10min");
&ProcessData("OverMind");

sub ProcessData
{
        # ... or get cpu stat info /proc/stat
        $line = `uptime`;
        $line =~ /average:.([\d.]+), ([\d.]+), ([\d.]+)/;
        $data1 = $1;
        $data2 = $2;
        $data3 = $3;
                chomp ($data1);
                chomp ($data2);
                chomp ($data3);
                $data1=$data1*3*100;
                $data2=$data2*3*100;
                $data3=$data3*3*100;
                # insert values into rrd
                RRDs::update "load_$_[0].rrd","N:$data1:$data2:$data3";
                # just to check;
                #print "RRDs::update"."$rrd/load_$_[0].rrd"."N:$data1:$data2:$data3\n";

        foreach $interval (@intervals) {
                #write a function CreateGraph .. to create them ...
                &CreateGraph($_[0], "day",$interval);
                &CreateGraph($_[0], "week",$interval);
                &CreateGraph($_[0], "month",$interval);
                &CreateGraph($_[0], "year",$interval);
        }
}

;flowscan?
;by any chance r u generating NetFlow? [or just parsing it?]

-- 
Best regards,
 mrugan                            mailto:mrugan at softhome.net

--
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