On Saturday 13 November 2004 09:50, Michael Thompson wrote:

Sorry, I just read that message and realised it does not make any sense!

What is happening is that it is logging data, but it is logging the verticle 
scale as k, it needs to show the difference in packets between each reading, 
and not have any m k or any other symbols apart from the amounts.

I did come up with the following code:

    # if rrdtool database doesn't exist, create it
        if (! -e "$rrd/$_[0].rrd")
        {
                print "creating rrd database for $_[0]..\n";
                RRDs::create "$rrd/$_[0].rrd",
                        "-s 300",
                        "DS:drop:DERIVE:600:0:12500000",
                        "RRA:AVERAGE:0.5:1:576",
                        "RRA:AVERAGE:0.5:6:672",
                        "RRA:AVERAGE:0.5:24:732",
                        "RRA:AVERAGE:0.5:144:1460";
        }

        # insert values into rrd
        RRDs::update "$rrd/$_[0].rrd",
                "-t", "in",
                "N:$in";

        # create traffic graphs
        &CreateGraph($_[0], "day", $_[1]);
        &CreateGraph($_[0], "week", $_[1]);
        &CreateGraph($_[0], "month", $_[1]);
        &CreateGraph($_[0], "year", $_[1]);
}

sub CreateGraph
 

{
# creates graph

        RRDs::graph "$img/$_[0]-$_[1].png",
                "-s -1$_[1]",
                "-t traffic on $_[0] :: $_[2]",
                "--lazy",
                "-h", "80", "-w", "600",
                "-l 0",
                "-a", "PNG",
                "-v bytes/sec",
                "DEF:drop=$rrd/$_[0].rrd:drop:AVERAGE",
                "AREA:drop#32CD32:Incoming",
                "LINE1:drop#336600",
                "GPRINT:drop:MAX:  Max\\: %5.1lf %s",
                "GPRINT:drop:AVERAGE: Avg\\: %5.1lf %S",
                "GPRINT:drop:LAST: Current\\: %5.1lf %Sbytes/sec\\n",
                "HRULE:0#000000";
        if ($ERROR = RRDs::error) { print "$0: unable to generate $_[0] $_[1] 
traffic graph: $ERROR\n"; }
}

But that prints m on the GPRINT lines, and I am not sure of how to get rid. I 
am also not entirly sure of the accuracy of the results.

Any thoughts??


Many Thanks for your time

Michael

--
Unsubscribe mailto:[EMAIL PROTECTED]
Help        mailto:[EMAIL PROTECTED]
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

Reply via email to