[rrd-users] Carriage return problem in "GPRINT" function

arai.jin at future.co.jp arai.jin at future.co.jp
Thu Feb 14 06:46:40 MET 2002


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

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",
my @FUNC = ("COMMENT:traffic     Max          Min         Average
           "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"

            "--title=Daily I/O traffic",


Jin Arai
arai.jin at future.co.jp

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