[rrd-users] Re: Escaping % in PRINT ?

Rrdtool Rrdtool at previnet.it
Wed Jul 30 14:16:34 MEST 2003


Thanks!
This works. As matter of fact I did try \\% and %% before posting, didn't
work, must have made something else wrong :(

diff -u routers2.org.cgi routers2.cgi
--- routers2.org.cgi    Tue Jul 29 17:42:26 2003
+++ routers2.cgi        Wed Jul 30 14:07:48 2003
@@ -3579,13 +3579,16 @@
                $legendi =~ s/:/\\:/g;
                $legendo =~ s/:/\\:/g;

+               my $perctemp;
+               ($perctemp = $q->b($legendi)) =~ s/%/%%/g;
                push @params,
-                       "PRINT:$mds0:MAX:".$q->b($legendi)." Max $ssin, ",
+                       "PRINT:$mds0:MAX:".$perctemp." Max $ssin, ",
                        "PRINT:$ds0:AVERAGE:Avg $ssin, ",
                        "PRINT:$ds0:LAST:Last $ssin ".$q->br
                                        if(!$interfaces{$interface}{noi});
+               ($perctemp = $q->b($legendo)) =~ s/%/%%/g;
                push @params,
-                       "PRINT:$mds1:MAX:".$q->b($legendo)." Max $ssout, ",
+                       "PRINT:$mds1:MAX:".$perctemp." Max $ssout, ",
                        "PRINT:$ds1:AVERAGE:Avg $ssout, ",
                        "PRINT:$ds1:LAST:Last $ssout ".$q->br
                                        if(!$interfaces{$interface}{noo});

Heiko

-- 
-- PREVINET S.p.A. www.previnet.it
-- Heiko Herold Heiko.Herold at previnet.it
-- +39-041-5907073 ph
-- +39-041-5907472 fax

> -----Original Message-----
> From: Alex van den Bogaerdt [mailto:alex at ergens.op.het.net]
> Sent: Wednesday, July 30, 2003 12:38 PM
> To: rrd-users List (E-mail)
> Subject: Re: Escaping % in PRINT ?
> 
> 
> On Wed, Jul 30, 2003 at 12:29:04PM +0200, Rrdtool wrote:
> 
> > RRD Error: bad format for [G]PRINT in 'Load % 1min Max 
> %6.2lf %s%%, '
> 
> ------------------------------------------------------------------^^
> 
> This produces a single percent character.  Do the same for that one
> between "load" and "1min".
> 
> HTH
> Alex
> 
> --
> 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
> 

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