diff --git a/program/src/rrd_tool.c b/program/src/rrd_tool.c
index cfd71a938c91da56eba77e06cf8adc8786247336..6aa53cc5b78dfdbc43266e2ac918c0746401eeac 100644 (file)
--- a/program/src/rrd_tool.c
+++ b/program/src/rrd_tool.c
/*****************************************************************************
/*****************************************************************************
- * RRDtool 1.1.x Copyright Tobias Oetiker, 1997 - 2002
+ * RRDtool 1.1.x Copyright Tobias Oetiker, 1997 - 2004
*****************************************************************************
* rrd_tool.c Startup wrapper
*****************************************************************************/
*****************************************************************************
* rrd_tool.c Startup wrapper
*****************************************************************************/
{
char help_main[] =
{
char help_main[] =
- "RRDtool 1.1.x Copyright 1997-2003 by Tobias Oetiker <tobi@oetiker.ch>\n"
+ "RRDtool 1.1.x Copyright 1997-2004 by Tobias Oetiker <tobi@oetiker.ch>\n"
#ifndef WIN32
" Compiled " MAKE_TIMESTAMP "\n\n"
#else
#ifndef WIN32
" Compiled " MAKE_TIMESTAMP "\n\n"
#else
"\t\t[ time:value[:value...] ..]\n\n";
char help_updatev[] =
"\t\t[ time:value[:value...] ..]\n\n";
char help_updatev[] =
- "* updatev - a verbose verion of update\n"
+ "* updatev - a verbose version of update\n"
"\treturns information about values, RRAs, and datasources updated\n\n"
"\trrdtool updatev filename\n"
"\t\t--template|-t ds-name:ds-name:...\n"
"\treturns information about values, RRAs, and datasources updated\n\n"
"\trrdtool updatev filename\n"
"\t\t--template|-t ds-name:ds-name:...\n"
"\t\t[--resolution|-r resolution]\n"
"\t\t[--start|-s start] [--end|-e end]\n\n";
"\t\t[--resolution|-r resolution]\n"
"\t\t[--start|-s start] [--end|-e end]\n\n";
- char help_graph[] =
+/* break up very large strings (help_graph, help_tune) for ISO C89 compliance*/
+
+ char help_graph1[] =
"* graph - generate a graph from one or several RRD\n\n"
"\trrdtool graph filename [-s|--start seconds] [-e|--end seconds]\n"
"\t\t[-x|--x-grid x-axis grid and label]\n"
"* graph - generate a graph from one or several RRD\n\n"
"\trrdtool graph filename [-s|--start seconds] [-e|--end seconds]\n"
"\t\t[-x|--x-grid x-axis grid and label]\n"
"\t\t[-h|--height pixels] [-o|--logarithmic]\n"
"\t\t[-u|--upper-limit value] [-z|--lazy]\n"
"\t\t[-l|--lower-limit value] [-r|--rigid]\n"
"\t\t[-h|--height pixels] [-o|--logarithmic]\n"
"\t\t[-u|--upper-limit value] [-z|--lazy]\n"
"\t\t[-l|--lower-limit value] [-r|--rigid]\n"
- "\t\t[-g|--no-legend]\n"
+ "\t\t[-g|--no-legend]\n";
+ char help_graph2[] =
+ "\t\t[-j|--only-graph]\n"
"\t\t[--font FONTTAG:size:font]\n"
"\t\t[--zoom factor]\n"
"\t\t[--alt-autoscale]\n"
"\t\t[--font FONTTAG:size:font]\n"
"\t\t[--zoom factor]\n"
"\t\t[--alt-autoscale]\n"
"\t\t[--step seconds]\n"
"\t\t[-f|--imginfo printfstr]\n"
"\t\t[-a|--imgformat PNG]\n"
"\t\t[--step seconds]\n"
"\t\t[-f|--imginfo printfstr]\n"
"\t\t[-a|--imgformat PNG]\n"
- "\t\t[-c|--color COLORTAG#rrggbb[aa]] [-t|--title string]\n"
+ "\t\t[-c|--color COLORTAG#rrggbb[aa]] [-t|--title string]\n";
+ char help_graph3[] =
"\t\t[DEF:vname=rrd:ds-name:CF]\n"
"\t\t[CDEF:vname=rpn-expression]\n"
"\t\t[PRINT:vname:CF:format]\n"
"\t\t[DEF:vname=rrd:ds-name:CF]\n"
"\t\t[CDEF:vname=rpn-expression]\n"
"\t\t[PRINT:vname:CF:format]\n"
"\t\t[AREA:vname[#rrggbb[aa][:legend]]]\n"
"\t\t[STACK:vname[#rrggbb[aa][:legend]]]\n\n";
"\t\t[AREA:vname[#rrggbb[aa][:legend]]]\n"
"\t\t[STACK:vname[#rrggbb[aa][:legend]]]\n\n";
- char help_tune[] =
+ char help_tune1[] =
" * tune - Modify some basic properties of an RRD\n\n"
"\trrdtool tune filename\n"
"\t\t[--heartbeat|-h ds-name:heartbeat]\n"
" * tune - Modify some basic properties of an RRD\n\n"
"\trrdtool tune filename\n"
"\t\t[--heartbeat|-h ds-name:heartbeat]\n"
"\t\t[--deltapos scale-value] [--deltaneg scale-value]\n"
"\t\t[--failure-threshold integer]\n"
"\t\t[--window-length integer]\n"
"\t\t[--deltapos scale-value] [--deltaneg scale-value]\n"
"\t\t[--failure-threshold integer]\n"
"\t\t[--window-length integer]\n"
- "\t\t[--alpha adaptation-parameter]\n"
+ "\t\t[--alpha adaptation-parameter]\n";
+ char help_tune2[] =
+ " * tune - Modify some basic properties of an RRD\n\n"
"\t\t[--beta adaptation-parameter]\n"
"\t\t[--gamma adaptation-parameter]\n"
"\t\t[--gamma-deviation adaptation-parameter]\n"
"\t\t[--aberrant-reset ds-name]\n\n";
char help_resize[] =
"\t\t[--beta adaptation-parameter]\n"
"\t\t[--gamma adaptation-parameter]\n"
"\t\t[--gamma-deviation adaptation-parameter]\n"
"\t\t[--aberrant-reset ds-name]\n\n";
char help_resize[] =
- " * resize - alter the lenght of one of the RRAs in an RRD\n\n"
+ " * resize - alter the length of one of the RRAs in an RRD\n\n"
"\trrdtool resize filename rranum GROW|SHRINK rows\n\n";
char help_xport[] =
"\trrdtool resize filename rranum GROW|SHRINK rows\n\n";
char help_xport[] =
"\t\t[XPORT:vname:legend]\n\n";
char help_quit[] =
"\t\t[XPORT:vname:legend]\n\n";
char help_quit[] =
- " * quit - closeing a session in remote mode\n\n"
+ " * quit - closing a session in remote mode\n\n"
"\trrdtool quit\n\n";
char help_ls[] =
"\trrdtool quit\n\n";
char help_ls[] =
char help_cd[] =
" * cd - changes the current directory\n\n"
char help_cd[] =
" * cd - changes the current directory\n\n"
- "\trrdtool cd new direcotry\n\n";
+ "\trrdtool cd new directory\n\n";
char help_mkdir[] =
char help_mkdir[] =
- " * mkdir - creates a new direcotry\n\n"
- "\trrdtool mkdir newdirecotryname\n\n";
+ " * mkdir - creates a new directory\n\n"
+ "\trrdtool mkdir newdirectoryname\n\n";
char help_lic[] =
"RRDtool is distributed under the Terms of the GNU General\n"
char help_lic[] =
"RRDtool is distributed under the Terms of the GNU General\n"
fputs(help_fetch, stdout);
break;
case C_GRAPH:
fputs(help_fetch, stdout);
break;
case C_GRAPH:
- fputs(help_graph, stdout);
+ fputs(help_graph1, stdout);
+ fputs(help_graph2, stdout);
+ fputs(help_graph3, stdout);
break;
case C_TUNE:
break;
case C_TUNE:
- fputs(help_tune, stdout);
+ fputs(help_tune1, stdout);
+ fputs(help_tune2, stdout);
break;
case C_RESIZE:
fputs(help_resize, stdout);
break;
case C_RESIZE:
fputs(help_resize, stdout);
if (strcmp(firstdir,"")){
chdir(firstdir);
if (errno!=0){
if (strcmp(firstdir,"")){
chdir(firstdir);
if (errno!=0){
- fprintf(stderr,"ERROR: %s\n",strerror(errno));
+ fprintf(stderr,"ERROR: %s\n",rrd_strerror(errno));
exit(errno);
}
}
exit(errno);
}
}
}
#if ! defined(HAVE_CHROOT) || ! defined(HAVE_GETUID)
if (getuid()==0 && ! ChangeRoot){
}
#if ! defined(HAVE_CHROOT) || ! defined(HAVE_GETUID)
if (getuid()==0 && ! ChangeRoot){
- printf("ERROR: chdir security problem - rrdtool is runnig as "
+ printf("ERROR: chdir security problem - rrdtool is running as "
"root an no chroot!\n");
return(0);
}
#endif
chdir(argv[2]);
if (errno!=0){
"root an no chroot!\n");
return(0);
}
#endif
chdir(argv[2]);
if (errno!=0){
- printf("ERROR: %s\n",strerror(errno));
+ printf("ERROR: %s\n",rrd_strerror(errno));
}
return(0);
}
}
return(0);
}
}
#if ! defined(HAVE_CHROOT) || ! defined(HAVE_GETUID)
if (getuid()==0 && ! ChangeRoot){
}
#if ! defined(HAVE_CHROOT) || ! defined(HAVE_GETUID)
if (getuid()==0 && ! ChangeRoot){
- printf("ERROR: mkdir security problem - rrdtool is runnig as "
+ printf("ERROR: mkdir security problem - rrdtool is running as "
"root an no chroot!\n");
return(0);
}
#endif
mkdir(argv[2],0777);
if (errno!=0){
"root an no chroot!\n");
return(0);
}
#endif
mkdir(argv[2],0777);
if (errno!=0){
- printf("ERROR: %s\n",strerror(errno));
+ printf("ERROR: %s\n",rrd_strerror(errno));
}
return(0);
}
}
return(0);
}
}
}
else{
}
}
else{
- printf("ERROR: %s\n",strerror(errno));
+ printf("ERROR: %s\n",rrd_strerror(errno));
return(errno);
}
return(0);
return(errno);
}
return(0);
strcmp("v", argv[1]) == 0 ||
strcmp("-v", argv[1]) == 0 ||
strcmp("-version", argv[1]) == 0 )
strcmp("v", argv[1]) == 0 ||
strcmp("-v", argv[1]) == 0 ||
strcmp("-version", argv[1]) == 0 )
- printf("RRDtool 1.1.x Copyright (C) 1997-2003 by Tobias Oetiker <tobi@oetiker.ch>\n");
+ printf("RRDtool 1.1.x Copyright (C) 1997-2004 by Tobias Oetiker <tobi@oetiker.ch>\n");
else if (strcmp("restore", argv[1]) == 0)
rrd_restore(argc-1, &argv[1]);
else if (strcmp("resize", argv[1]) == 0)
rrd_resize(argc-1, &argv[1]);
else if (strcmp("last", argv[1]) == 0)
else if (strcmp("restore", argv[1]) == 0)
rrd_restore(argc-1, &argv[1]);
else if (strcmp("resize", argv[1]) == 0)
rrd_resize(argc-1, &argv[1]);
else if (strcmp("last", argv[1]) == 0)
- printf("%ld\n",rrd_last(argc-1, &argv[1]));
+ printf("%ld\n",rrd_last(argc-1, argv[1]));
else if (strcmp("update", argv[1]) == 0)
rrd_update(argc-1, &argv[1]);
else if (strcmp("fetch", argv[1]) == 0) {
else if (strcmp("update", argv[1]) == 0)
rrd_update(argc-1, &argv[1]);
else if (strcmp("fetch", argv[1]) == 0) {
}
else if (strcmp("graph", argv[1]) == 0) {
char **calcpr;
}
else if (strcmp("graph", argv[1]) == 0) {
char **calcpr;
+#ifdef notused /*XXX*/
const char *imgfile = argv[2]; /* rrd_graph changes argv pointer */
const char *imgfile = argv[2]; /* rrd_graph changes argv pointer */
+#endif
int xsize, ysize;
int i;
int tostdout = (strcmp(argv[2],"-") == 0);
int xsize, ysize;
int i;
int tostdout = (strcmp(argv[2],"-") == 0);
- if( rrd_graph(argc-1, &argv[1], &calcpr, &xsize, &ysize) != -1 ) {
+ if( rrd_graph(argc-1, &argv[1], &calcpr, &xsize, &ysize, NULL) != -1 ) {
if (!tostdout)
printf ("%dx%d\n",xsize,ysize);
if (calcpr) {
if (!tostdout)
printf ("%dx%d\n",xsize,ysize);
if (calcpr) {