Hi,all

I'm trying to print MAX/MIN/AVERAGE data of router traffic into graph
(just like MRTG), but the Carriage Return ('\n') doesn't work in Perl
script.

The statement in the script is shown below.
All '\n's in "COMMENT" and "GPRINT" statements don't work, all words are
printed in single line (rewinded at the edge of the graph).

I tried to write these scripts in bash script, and that works well.
Does RRDs bindings have problem about carriage return code?

Does anyone have any idea?

===========================
my @DEF = ("DEF:in=$path_rrd:in:AVERAGE",
           "DEF:out=$path_rrd:out:AVERAGE",
           "CDEF:inbits=in,8,*",
           "CDEF:outbits=out,8,*");
my @FUNC = ("COMMENT:traffic     Max          Min         Average
\r\n",
           "AREA:inbits#00FF00:In Traffic",
           "GPRINT:inbits:MAX:%6.2lf %sbps",
           "GPRINT:inbits:MIN:%6.2lf %sbps",
           "GPRINT:inbits:AVERAGE:%6.2lf %sbps\n",
           "LINE1:outbits#0000FF:Out Traffic",
           "GPRINT:outbits:MAX:\"%6.2lf %sbps\"",
           "GPRINT:outbits:MIN:\"%6.2lf %sbps\"",
           "GPRINT:outbits:AVERAGE:\"%6.2lf %sbps\n\"",
           "COMMENT: " . "\nmodified at " . `date` . "\n"
           );

RRDs::graph($day_graph,
            "--imgformat=PNG",
            "--title=Daily I/O traffic",
            "--start=-86400",
            "--vertical-label=bps",
           "--width=800",
           "--height=300",
            "--upper-limit=128000",
            "--lower-limit=0",
            "--rigid",
            @DEF,
            @FUNC
            );
===========================

regards


--
Jin Arai
[EMAIL PROTECTED]

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