diff --git a/program/src/rrd_tool.c b/program/src/rrd_tool.c
index 037894085141c1a3c54d5cc18e19c28061f25274..d23094f8d12bfb703f3a0c2342d8d009faea8f48 100644 (file)
--- a/program/src/rrd_tool.c
+++ b/program/src/rrd_tool.c
char help_main[] =
"RRDtool 1.1.x Copyright 1997-2003 by Tobias Oetiker <tobi@oetiker.ch>\n"
char help_main[] =
"RRDtool 1.1.x Copyright 1997-2003 by Tobias Oetiker <tobi@oetiker.ch>\n"
+#ifndef WIN32
" Compiled " MAKE_TIMESTAMP "\n\n"
" Compiled " MAKE_TIMESTAMP "\n\n"
+#else
+ " Compiled " __DATE__ " " __TIME__ "\n\n"
+#endif
"Usage: rrdtool [options] command command_options\n\n";
char help_list[] =
"Usage: rrdtool [options] command command_options\n\n";
char help_list[] =
- "Valid commands: create, update, graph, dump, restore,\n"
+ "Valid commands: create, update, updatev, graph, dump, restore,\n"
"\t\tlast, info, fetch, tune, resize, xport\n\n";
char help_listremote[] =
"\t\tlast, info, fetch, tune, resize, xport\n\n";
char help_listremote[] =
char help_restore[] =
"* restore - restore an RRD file from its XML form\n\n"
char help_restore[] =
"* restore - restore an RRD file from its XML form\n\n"
- "\trrdtool restore [--range-check|-r] filename.xml filename.rrd\n\n";
+ "\trrdtool restore [--range-check|-r] [--force-overwrite|-f] filename.xml filename.rrd\n\n";
char help_last[] =
"* last - show last update time for RRD\n\n"
char help_last[] =
"* last - show last update time for RRD\n\n"
"\t\ttime|N:value[:value...]\n\n"
"\t\tat-time@value[:value...]\n\n"
"\t\t[ time:value[:value...] ..]\n\n";
"\t\ttime|N:value[:value...]\n\n"
"\t\tat-time@value[:value...]\n\n"
"\t\t[ time:value[:value...] ..]\n\n";
+
+ char help_updatev[] =
+ "* updatev - a verbose verion 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"
+ "\t\ttime|N:value[:value...]\n\n"
+ "\t\tat-time@value[:value...]\n\n"
+ "\t\t[ time:value[:value...] ..]\n\n";
char help_fetch[] =
"* fetch - fetch data out of an RRD\n\n"
char help_fetch[] =
"* fetch - fetch data out of an RRD\n\n"
enum { C_NONE, C_CREATE, C_DUMP, C_INFO, C_RESTORE, C_LAST,
C_UPDATE, C_FETCH, C_GRAPH, C_TUNE, C_RESIZE, C_XPORT,
enum { C_NONE, C_CREATE, C_DUMP, C_INFO, C_RESTORE, C_LAST,
C_UPDATE, C_FETCH, C_GRAPH, C_TUNE, C_RESIZE, C_XPORT,
- C_QUIT, C_LS, C_CD, C_MKDIR };
+ C_QUIT, C_LS, C_CD, C_MKDIR, C_UPDATEV };
int help_cmd = C_NONE;
int help_cmd = C_NONE;
help_cmd = C_LAST;
else if (!strcmp(cmd,"update"))
help_cmd = C_UPDATE;
help_cmd = C_LAST;
else if (!strcmp(cmd,"update"))
help_cmd = C_UPDATE;
+ else if (!strcmp(cmd,"updatev"))
+ help_cmd = C_UPDATEV;
else if (!strcmp(cmd,"fetch"))
help_cmd = C_FETCH;
else if (!strcmp(cmd,"graph"))
else if (!strcmp(cmd,"fetch"))
help_cmd = C_FETCH;
else if (!strcmp(cmd,"graph"))
case C_UPDATE:
fputs(help_update, stdout);
break;
case C_UPDATE:
fputs(help_update, stdout);
break;
+ case C_UPDATEV:
+ fputs(help_updatev, stdout);
+ break;
case C_FETCH:
fputs(help_fetch, stdout);
break;
case C_FETCH:
fputs(help_fetch, stdout);
break;
rrd_create(argc-1, &argv[1]);
else if (strcmp("dump", argv[1]) == 0)
rrd_dump(argc-1, &argv[1]);
rrd_create(argc-1, &argv[1]);
else if (strcmp("dump", argv[1]) == 0)
rrd_dump(argc-1, &argv[1]);
- else if (strcmp("info", argv[1]) == 0){
+ else if (strcmp("info", argv[1]) == 0
+ || strcmp("updatev", argv[1]) == 0){
info_t *data,*save;
info_t *data,*save;
- data=rrd_info(argc-1, &argv[1]);
+ if (strcmp("info",argv[1]) == 0)
+ data=rrd_info(argc-1, &argv[1]);
+ else
+ data=rrd_update_v(argc-1, &argv[1]);
while (data) {
save=data;
printf ("%s = ", data->key);
while (data) {
save=data;
printf ("%s = ", data->key);
case RD_I_CNT:
printf ("%lu", data->value.u_cnt);
break;
case RD_I_CNT:
printf ("%lu", data->value.u_cnt);
break;
+ case RD_I_INT:
+ printf ("%d", data->value.u_int);
+ break;
case RD_I_STR:
printf ("\"%s\"", data->value.u_str);
free(data->value.u_str);
case RD_I_STR:
printf ("\"%s\"", data->value.u_str);
free(data->value.u_str);
datai=data;
printf(" ");
for (i = 0; i<ds_cnt;i++)
datai=data;
printf(" ");
for (i = 0; i<ds_cnt;i++)
- printf("%14s",ds_namv[i]);
+ printf("%20s",ds_namv[i]);
printf ("\n\n");
for (ti = start+step; ti <= end; ti += step){
printf("%10lu:", ti);
printf ("\n\n");
for (ti = start+step; ti <= end; ti += step){
printf("%10lu:", ti);
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) {