Hi,
You will have to double escape the CR to '\\n'
See the help at the website for rrdtool graph
"In a ':' in a legend argument will mark the end of the legend. To enter a
':' into a legend, the colon must be escaped with a backslash '\:'. Beware,
that many environments look for backslashes themselves, so it may be
necessary to write two backslashes so that one is passed onto rrd_graph."
hth
paul
*speaking for himself
String Formatting
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
--
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