[rrd-users] Help with RRD Graph overlay

Girish Radhakrishnan girish at xacct.com
Fri Oct 31 13:14:36 MET 2003


I have been trying to add an overlay image to my graph but it does not
show up on the graph
 
Could somebody please help in understanding what am I doing wrong?
 
-Girish
 
The configuration:
 
RedHat 9.0 Linux 2.4.18-10 #10 
RRDtool version 1.0.45 
gd-1.8.4-11
gd-devel-1.8.4-11
The Graph displays everything except the overlay.
 
This is how I run it
 
========================================================================
=======
CRITICAL=60000000
rrdtool graph -v Mbytes --overlay back.gd -w 400 -h 200 --no-minor -t
"Memory Statistics of Linux machine in \
London UK" ma.gif \
DEF:mem=mem_stats.rrd:Memory_Free:AVERAGE \
CDEF:mem_cr=mem,$CRITICAL,LT,mem,0,IF \
CDEF:mem_min=mem,$MIN_VAL,LT,mem,0,IF \
CDEF:mem_avg=mem,$AVG_VAL,LT,mem,0,IF \
CDEF:mem_max=mem,$MAX_VAL,LT,mem,0,IF \
CDEF:mem_hi=mem,$MAX_VAL,GT,mem,0,IF \
COMMENT:"X-Axis in GMT"\\c \
AREA:mem_hi#000080:"Memory is Higher than previous time Max" \
AREA:mem_max#00FF00:"Memory is higher than average"\\l \
AREA:mem_avg#006400:"Memory is less than Average" \
AREA:mem_min#8B0000:"Memory is less than Minimum"\\l \
AREA:mem_cr#FF0000:"Memory is less than Critical"\\l \
HRULE:$CRITICAL#FF0000:"Critical"\\r \
COMMENT:" Max          Min         Average         Critical"\\c \
PRINT:mem:MAX:"%.0lf" \
PRINT:mem:MIN:"%.0lf" \
PRINT:mem:AVERAGE:"%.0lf" \
GPRINT:mem:MAX:"%6.2lf %sB  " \
GPRINT:mem:MIN:"%5.2lf %sB  " \
GPRINT:mem:AVERAGE:"%6.2lf %sB         6.00 MB"\\c | sed
's/[0-9]*x[0-9]*//'
========================================================================
========
 
The Background gd image creation source file:
/* Bring in gd library functions */
#include <gd.h>
 
/* Bring in standard I/O so we can output the PNG to a file */
#include <stdio.h>
 
int main() {
        /* Declare the image */
        gdImagePtr im;
        /* Declare output files */
        FILE *pngout;
        /* Declare color indexes */
        int black;
        int white;
 
        /* Allocate the image: 64 pixels across by 64 pixels tall */
        im = gdImageCreate(200, 200);
 
        /* Allocate the color black (red, green and blue all minimum).
                Since this is the first color in a new image, it will
                be the background color. */
        white = gdImageColorAllocate(im, 255, 255, 255);
        black = gdImageColorAllocate(im, 0, 0, 0);
 
        /* Allocate the color white (red, green and blue all maximum).
*/
        //white = gdImageColorAllocate(im, 255, 255, 255);
 
        /* Draw a line from the upper left to the lower right,
                using white color index. */
        gdImageRectangle(im, 200, 0, 399, 199, black);
 
        /* Open a file for writing. "wb" means "write binary", important
                under MSDOS, harmless under Unix. */
        pngout = fopen("test.png", "wb");
 
        /* Output the image to the disk file in PNG format. */
        gdImagePng(im, pngout);
 
        /* Close the files. */
        fclose(pngout);

        /* Destroy the image in memory. */
        gdImageDestroy(im);
}
========================================================================
=======
 
 
 


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