[rrd-users] Character 'plus' in rrdcgi

joseantonio.duenas at auna.es joseantonio.duenas at auna.es
Tue Sep 27 13:53:54 MEST 2005



Hey list.

I've a perl CGI.
When I run it with parameter (manager=SV+&periodo=6h&ancho=88&alto=45)
don't work.

**************************************************

#!/usr/bin/perl

use lib qw( /usr/local/rrdtool-1.2.11/lib/perl );
use CGI;
use RRDs;
use Getopt::Std;
use File::Basename;

use vars qw($q);

# initialize CGI
$q = new CGI;

$manager=$q->param('manager');
$periodo=$q->param('periodo');
$ancho=$q->param('ancho');
$alto=$q->param('alto');

$rrd="/home/rrdtool/colectores/$manager.rrd";
print $q->header({ -type=>"image/png",
-expires=>"now",-align=>'MIDDLE',-Content-Disposition=>"filename=\"\"" });

my ($graphret,$xs,$ys) = RRDs::graph "-",
  "--start", "-$periodo",
  "--lower-limit=0",
  "--imgformat","PNG",
  "--units-exponent", "0",
  "--width=$ancho",
  "--height=$alto",
  "-c", "BACK#FFFFFF",
  "-c", "ARROW#FFFFFF",
  "-c", "GRID#B5B5B5",
  "-c", "MGRID#878787",
  "-c", "FONT#0B3A57",
  "-c", "SHADEA#FFFFFF",
  "-c", "SHADEB#FFFFFF",
  "-c", "AXIS#787878",
  "--no-legend",
  "DEF:num_alarmas=$rrd:alarmas:MAX",
  "AREA:num_alarmas#F7F7EE",
  "LINE1:num_alarmas#748686",
;


If I run a script like this (with parameters SV+ 1h), it works fine.

#!/bin/sh

rrd=/home/rrdtool/colectores/$1.rrd
last=`/usr/local/rrdtool-1.2.11/bin/rrdtool last $rrd`
file1=/home/rrdtool/graphics/$1_$2.png
fecha=`date +"%c %Z"`
width=339
height=167

/usr/local/rrdtool-1.2.11/bin/rrdtool graph $file1 \
--imgformat PNG                                    \
--start -$2                                        \
--units-exponent 0                                 \
--width $width                                     \
--height $height                                   \
--color BACK#FFFFFF                                \
--color ARROW#FFFFFF                               \
--color GRID#B5B5B5                                \
--color MGRID#878787                               \
--color FONT#0B3A57                                \
--color SHADEA#FFFFFF                              \
--color SHADEB#FFFFFF                              \
--color AXIS#787878                                \
--no-legend                                        \
DEF:num_alarmas=$rrd:alarmas:MAX                   \
AREA:num_alarmas\#F7F7EE                           \
LINE1:num_alarmas\#748686


Thnx in advance for any comments.

--
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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list