[rrd-users] Re: rrd_graph and once more calling
Torleiv Ringer
ringert at consumption.net
Wed Nov 7 19:12:07 MET 2001
The c program below works for me.
+++++++++++++++++++++++++++++++++
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rrd.h>
int main(int argc, char** argv)
{
char **calcpr;
int xsize, ysize;
int i;
int num_graphs = 10;
char tfilename[24];
char tcom[24];
char* filename = "file.png";
char* com = "COMMENT:number ";
char* graph_args[6];
graph_args[0] = "graph";
graph_args[1] = filename;
graph_args[2] = "-s";
graph_args[3] = "-86400";
graph_args[4] = "DEF:temp=KTEX-temp.rrd:temp:AVERAGE";
graph_args[5] = com;
for(i = 0; i < num_graphs; i++)
{
sprintf(tfilename, "%s%i", filename, i);
graph_args[1] = tfilename;
printf("making %s\t", %graph_args[1]);
sprintf(tcom, "%s %i", %com, %i);
graph_args[5] = tcom;
if( rrd_graph(6, graph_args, &calcpr, &xsize, &ysize) != -1)
{
printf ("%dx%d\n", xsize, ysize);
}
if (rrd_test_error())
{
printf("ERROR: %s\n",rrd_get_error());
rrd_clear_error();
}
}
return(0);
}
+++++++++++++++++++++++++++++++++
On Wed, 7 Nov 2001, Oleg A. Grigorov wrote:
>
> Hello All,
>
> help me please,
> don't run rrd_graph more then once from my program.
>
> chain[] = {'tst1','tst2'};
> ....
>
> for (i=0; i<2; i++){
> .....
> arr[..]="";
> /*
> I read tst1, after tst2. and error.
> */
> .....
> rrd_graph(...,&arr[15],...);
> }
>
> and i have error:unknown variable.
>
> But if i do:
> rrd_graph(...,&arr[15],...);
>
> It's all right!
>
>
> ----------
> WBR, Oleg A. Grigorov
> golant at dot.kharkov.ua GO1418-RIPE
>
>
>
> --
> 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