1 /*****************************************************************************
2 * RRDtool 1.4.3 Copyright by Tobi Oetiker, 1997-2010
3 *****************************************************************************
4 * rrd_tool.c Startup wrapper
5 *****************************************************************************/
7 #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(HAVE_CONFIG_H)
8 #include "../win32/config.h"
13 #include "../rrd_config.h"
18 #include "rrd_xport.h"
41 #define MAX_LENGTH 10000
48 const char *help_main =
50 " Copyright 1997-2009 by Tobias Oetiker <tobi@oetiker.ch>\n"
52 "Usage: rrdtool [options] command command_options\n");
54 const char *help_list =
56 ("Valid commands: create, update, updatev, graph, graphv, dump, restore,\n"
57 "\t\tlast, lastupdate, first, info, fetch, tune,\n"
58 "\t\tresize, xport, flushcached\n");
60 const char *help_listremote =
61 N_("Valid remote commands: quit, ls, cd, mkdir, pwd\n");
64 const char *help_create =
65 N_("* create - create a new RRD\n\n"
66 "\trrdtool create filename [--start|-b start time]\n"
67 "\t\t[--step|-s step]\n"
68 "\t\t[--no-overwrite|-O]\n"
69 "\t\t[DS:ds-name:DST:dst arguments]\n"
70 "\t\t[RRA:CF:cf arguments]\n");
72 const char *help_dump =
73 N_("* dump - dump an RRD to XML\n\n"
74 "\trrdtool dump filename.rrd >filename.xml\n");
76 const char *help_info =
77 N_("* info - returns the configuration and status of the RRD\n\n"
78 "\trrdtool info filename.rrd\n");
80 const char *help_restore =
81 N_("* restore - restore an RRD file from its XML form\n\n"
82 "\trrdtool restore [--range-check|-r] [--force-overwrite|-f] filename.xml filename.rrd\n");
84 const char *help_last =
85 N_("* last - show last update time for RRD\n\n"
86 "\trrdtool last filename.rrd\n");
88 const char *help_lastupdate =
89 N_("* lastupdate - returns the most recent datum stored for\n"
90 " each DS in an RRD\n\n" "\trrdtool lastupdate filename.rrd\n");
92 const char *help_first =
93 N_("* first - show first update time for RRA within an RRD\n\n"
94 "\trrdtool first filename.rrd [--rraindex number]\n");
96 const char *help_update =
97 N_("* update - update an RRD\n\n"
98 "\trrdtool update filename\n"
99 "\t\t[--template|-t ds-name:ds-name:...]\n"
100 "\t\t[--daemon <address>]\n"
101 "\t\ttime|N:value[:value...]\n\n"
102 "\t\tat-time@value[:value...]\n\n"
103 "\t\t[ time:value[:value...] ..]\n");
105 const char *help_updatev =
106 N_("* updatev - a verbose version of update\n"
107 "\treturns information about values, RRAs, and datasources updated\n\n"
108 "\trrdtool updatev filename\n"
109 "\t\t[--template|-t ds-name:ds-name:...]\n"
110 "\t\ttime|N:value[:value...]\n\n"
111 "\t\tat-time@value[:value...]\n\n"
112 "\t\t[ time:value[:value...] ..]\n");
114 const char *help_fetch =
115 N_("* fetch - fetch data out of an RRD\n\n"
116 "\trrdtool fetch filename.rrd CF\n"
117 "\t\t[-r|--resolution resolution]\n"
118 "\t\t[-s|--start start] [-e|--end end]\n"
119 "\t\t[--daemon <address>]\n");
121 const char *help_flushcached =
122 N_("* flushcached - flush cached data out to an RRD file\n\n"
123 "\trrdtool flushcached filename.rrd\n"
124 "\t\t[--daemon <address>]\n");
126 /* break up very large strings (help_graph, help_tune) for ISO C89 compliance*/
128 const char *help_graph0 =
129 N_("* graph - generate a graph from one or several RRD\n\n"
130 "\trrdtool graph filename [-s|--start seconds] [-e|--end seconds]\n");
131 const char *help_graphv0 =
132 N_("* graphv - generate a graph from one or several RRD\n"
133 " with meta data printed before the graph\n\n"
134 "\trrdtool graphv filename [-s|--start seconds] [-e|--end seconds]\n");
135 const char *help_graph1 =
136 N_("\t\t[-x|--x-grid x-axis grid and label]\n"
137 "\t\t[-Y|--alt-y-grid] [--full-size-mode]\n"
138 "\t\t[-y|--y-grid y-axis grid and label]\n"
139 "\t\t[-v|--vertical-label string] [-w|--width pixels]\n"
140 "\t\t[--right-axis scale:shift] [--right-axis-label label]\n"
141 "\t\t[--right-axis-format format]\n"
142 "\t\t[-h|--height pixels] [-o|--logarithmic]\n"
143 "\t\t[-u|--upper-limit value] [-z|--lazy]\n"
144 "\t\t[-l|--lower-limit value] [-r|--rigid]\n"
145 "\t\t[-g|--no-legend] [--daemon <address>]\n"
146 "\t\t[-F|--force-rules-legend]\n" "\t\t[-j|--only-graph]\n");
147 const char *help_graph2 =
148 N_("\t\t[-n|--font FONTTAG:size:font]\n"
149 "\t\t[-m|--zoom factor]\n"
150 "\t\t[-A|--alt-autoscale]\n"
151 "\t\t[-M|--alt-autoscale-max]\n"
152 "\t\t[-G|--graph-render-mode {normal,mono}]\n"
153 "\t\t[-R|--font-render-mode {normal,light,mono}]\n"
154 "\t\t[-B|--font-smoothing-threshold size]\n"
155 "\t\t[-T|--tabwidth width]\n"
156 "\t\t[-E|--slope-mode]\n"
157 "\t\t[-P|--pango-markup]\n"
158 "\t\t[-N|--no-gridfit]\n"
159 "\t\t[-X|--units-exponent value]\n"
160 "\t\t[-L|--units-length value]\n"
161 "\t\t[-S|--step seconds]\n"
162 "\t\t[-f|--imginfo printfstr]\n"
163 "\t\t[-a|--imgformat PNG]\n"
164 "\t\t[-c|--color COLORTAG#rrggbb[aa]]\n"
165 "\t\t[--border width\n"
166 "\t\t[-t|--title string]\n"
167 "\t\t[-W|--watermark string]\n"
168 "\t\t[DEF:vname=rrd:ds-name:CF]\n");
169 const char *help_graph3 =
170 N_("\t\t[CDEF:vname=rpn-expression]\n"
171 "\t\t[VDEF:vdefname=rpn-expression]\n"
172 "\t\t[PRINT:vdefname:format]\n"
173 "\t\t[GPRINT:vdefname:format]\n" "\t\t[COMMENT:text]\n"
174 "\t\t[SHIFT:vname:offset]\n"
175 "\t\t[TEXTALIGN:{left|right|justified|center}]\n"
176 "\t\t[TICK:vname#rrggbb[aa][:[fraction][:legend]]]\n"
177 "\t\t[HRULE:value#rrggbb[aa][:legend]]\n"
178 "\t\t[VRULE:value#rrggbb[aa][:legend]]\n"
179 "\t\t[LINE[width]:vname[#rrggbb[aa][:[legend][:STACK]]]]\n"
180 "\t\t[AREA:vname[#rrggbb[aa][:[legend][:STACK]]]]\n"
181 "\t\t[PRINT:vname:CF:format] (deprecated)\n"
182 "\t\t[GPRINT:vname:CF:format] (deprecated)\n"
183 "\t\t[STACK:vname[#rrggbb[aa][:legend]]] (deprecated)\n");
184 const char *help_tune1 =
185 N_(" * tune - Modify some basic properties of an RRD\n\n"
186 "\trrdtool tune filename\n"
187 "\t\t[--heartbeat|-h ds-name:heartbeat]\n"
188 "\t\t[--data-source-type|-d ds-name:DST]\n"
189 "\t\t[--data-source-rename|-r old-name:new-name]\n"
190 "\t\t[--minimum|-i ds-name:min] [--maximum|-a ds-name:max]\n"
191 "\t\t[--deltapos scale-value] [--deltaneg scale-value]\n"
192 "\t\t[--failure-threshold integer]\n"
193 "\t\t[--window-length integer]\n"
194 "\t\t[--alpha adaptation-parameter]\n");
195 const char *help_tune2 =
196 N_("\t\t[--beta adaptation-parameter]\n"
197 "\t\t[--gamma adaptation-parameter]\n"
198 "\t\t[--gamma-deviation adaptation-parameter]\n"
199 "\t\t[--aberrant-reset ds-name]\n");
200 const char *help_resize =
202 (" * resize - alter the length of one of the RRAs in an RRD\n\n"
203 "\trrdtool resize filename rranum GROW|SHRINK rows\n");
204 const char *help_xport =
205 N_("* xport - generate XML dump from one or several RRD\n\n"
206 "\trrdtool xport [-s|--start seconds] [-e|--end seconds]\n"
207 "\t\t[-m|--maxrows rows]\n" "\t\t[--step seconds]\n"
208 "\t\t[--enumds]\n" "\t\t[DEF:vname=rrd:ds-name:CF]\n"
209 "\t\t[CDEF:vname=rpn-expression]\n"
210 "\t\t[XPORT:vname:legend]\n");
211 const char *help_quit =
212 N_(" * quit - closing a session in remote mode\n\n"
214 const char *help_ls =
215 N_(" * ls - lists all *.rrd files in current directory\n\n"
217 const char *help_cd =
218 N_(" * cd - changes the current directory\n\n"
219 "\trrdtool cd new directory\n");
220 const char *help_mkdir =
221 N_(" * mkdir - creates a new directory\n\n"
222 "\trrdtool mkdir newdirectoryname\n");
223 const char *help_pwd =
224 N_(" * pwd - returns the current working directory\n\n"
226 const char *help_lic =
227 N_("RRDtool is distributed under the Terms of the GNU General\n"
228 "Public License Version 2. (www.gnu.org/copyleft/gpl.html)\n\n"
229 "For more information read the RRD manpages\n");
230 enum { C_NONE, C_CREATE, C_DUMP, C_INFO, C_RESTORE, C_LAST,
231 C_LASTUPDATE, C_FIRST, C_UPDATE, C_FETCH, C_GRAPH, C_GRAPHV,
233 C_RESIZE, C_XPORT, C_QUIT, C_LS, C_CD, C_MKDIR, C_PWD,
234 C_UPDATEV, C_FLUSHCACHED
236 int help_cmd = C_NONE;
239 if (!strcmp(cmd, "create"))
241 else if (!strcmp(cmd, "dump"))
243 else if (!strcmp(cmd, "info"))
245 else if (!strcmp(cmd, "restore"))
246 help_cmd = C_RESTORE;
247 else if (!strcmp(cmd, "last"))
249 else if (!strcmp(cmd, "lastupdate"))
250 help_cmd = C_LASTUPDATE;
251 else if (!strcmp(cmd, "first"))
253 else if (!strcmp(cmd, "update"))
255 else if (!strcmp(cmd, "updatev"))
256 help_cmd = C_UPDATEV;
257 else if (!strcmp(cmd, "fetch"))
259 else if (!strcmp(cmd, "flushcached"))
260 help_cmd = C_FLUSHCACHED;
261 else if (!strcmp(cmd, "graph"))
263 else if (!strcmp(cmd, "graphv"))
265 else if (!strcmp(cmd, "tune"))
267 else if (!strcmp(cmd, "resize"))
269 else if (!strcmp(cmd, "xport"))
271 else if (!strcmp(cmd, "quit"))
273 else if (!strcmp(cmd, "ls"))
275 else if (!strcmp(cmd, "cd"))
277 else if (!strcmp(cmd, "mkdir"))
279 else if (!strcmp(cmd, "pwd"))
282 fprintf(stdout, _(help_main), PACKAGE_VERSION, __DATE__, __TIME__);
288 puts(_(help_listremote));
292 puts(_(help_create));
301 puts(_(help_restore));
307 puts(_(help_lastupdate));
313 puts(_(help_update));
316 puts(_(help_updatev));
322 puts(_(help_flushcached));
325 puts(_(help_graph0));
326 puts(_(help_graph1));
327 puts(_(help_graph2));
328 puts(_(help_graph3));
331 puts(_(help_graphv0));
332 puts(_(help_graph1));
333 puts(_(help_graph2));
334 puts(_(help_graph3));
341 puts(_(help_resize));
365 static char *fgetslong(
370 size_t bufsize = MAX_LENGTH;
374 return *aLinePtr = 0;
375 if (!(linebuf = malloc(bufsize))) {
376 perror("fgetslong: malloc");
380 while (fgets(linebuf + eolpos, MAX_LENGTH, stream)) {
381 eolpos += strlen(linebuf + eolpos);
382 if (linebuf[eolpos - 1] == '\n')
383 return *aLinePtr = linebuf;
384 bufsize += MAX_LENGTH;
385 if (!(linebuf = realloc(linebuf, bufsize))) {
387 perror("fgetslong: realloc");
392 return *aLinePtr = linebuf;
395 return *aLinePtr = 0;
406 #ifdef MUST_DISABLE_SIGFPE
407 signal(SIGFPE, SIG_IGN);
409 #ifdef MUST_DISABLE_FPMASK
413 /* initialize locale settings
414 according to localeconv(3) */
415 setlocale(LC_ALL, "");
417 #if defined(HAVE_LIBINTL_H) && defined(BUILD_LIBINTL)
418 bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
419 textdomain(GETTEXT_PACKAGE);
426 if (((argc == 2) || (argc == 3)) && !strcmp("-", argv[1])) {
428 struct rusage myusage;
429 struct timeval starttime;
430 struct timeval currenttime;
432 gettimeofday(&starttime, NULL);
435 if ((argc == 3) && strcmp("", argv[2])) {
446 if (chroot(argv[2]) != 0){
447 fprintf(stderr, "ERROR: chroot %s: %s\n", argv[2],rrd_strerror(errno));
454 "ERROR: change root is not supported by your OS "
455 "or at least by this copy of rrdtool\n");
462 if (strcmp(firstdir, "")) {
463 if (chdir(firstdir) != 0){
464 fprintf(stderr, "ERROR: chdir %s %s\n", firstdir,rrd_strerror(errno));
469 while (fgetslong(&aLine, stdin)) {
470 char *aLineOrig = aLine;
471 if ((argc = CountArgs(aLine)) == 0) {
473 printf("ERROR: not enough arguments\n");
476 if ((myargv = (char **) malloc((argc + 1) *
477 sizeof(char *))) == NULL) {
481 if ((argc = CreateArgs(argv[0], aLine, myargv)) < 0) {
482 printf("ERROR: creating arguments\n");
484 if ( HandleInputLine(argc, myargv, stdout) == 0 ){
486 getrusage(RUSAGE_SELF, &myusage);
487 gettimeofday(¤ttime, NULL);
488 printf("OK u:%1.2f s:%1.2f r:%1.2f\n",
489 (double) myusage.ru_utime.tv_sec +
490 (double) myusage.ru_utime.tv_usec / 1000000.0,
491 (double) myusage.ru_stime.tv_sec +
492 (double) myusage.ru_stime.tv_usec / 1000000.0,
493 (double) (currenttime.tv_sec - starttime.tv_sec)
494 + (double) (currenttime.tv_usec -
502 fflush(stdout); /* this is important for pipes to work */
506 } else if (argc == 2) {
509 } else if (argc == 3 && !strcmp(argv[1], "help")) {
513 exit(HandleInputLine(argc, argv, stderr));
518 /* HandleInputLine is NOT thread safe - due to readdir issues,
519 resolving them portably is not really simple. */
525 #if defined(HAVE_OPENDIR) && defined (HAVE_READDIR)
526 DIR *curdir; /* to read current dir with ls */
529 #if defined(HAVE_SYS_STAT_H)
533 /* Reset errno to 0 before we start.
536 if (argc > 1 && strcmp("quit", argv[1]) == 0) {
538 printf("ERROR: invalid parameter count for quit\n");
543 #if defined(HAVE_OPENDIR) && defined(HAVE_READDIR) && defined(HAVE_CHDIR)
544 if (argc > 1 && strcmp("cd", argv[1]) == 0) {
546 printf("ERROR: invalid parameter count for cd\n");
549 #if ! defined(HAVE_CHROOT) || ! defined(HAVE_GETUID)
550 if (getuid() == 0 && !ChangeRoot) {
552 ("ERROR: chdir security problem - rrdtool is running as "
553 "root but not chroot!\n");
557 if (chdir(argv[2]) != 0){
558 printf("ERROR: chdir %s %s\n", argv[2], rrd_strerror(errno));
563 if (argc > 1 && strcmp("pwd", argv[1]) == 0) {
564 char *cwd; /* To hold current working dir on call to pwd */
566 printf("ERROR: invalid parameter count for pwd\n");
569 cwd = getcwd(NULL, MAXPATH);
571 printf("ERROR: getcwd %s\n", rrd_strerror(errno));
578 if (argc > 1 && strcmp("mkdir", argv[1]) == 0) {
580 printf("ERROR: invalid parameter count for mkdir\n");
583 #if ! defined(HAVE_CHROOT) || ! defined(HAVE_GETUID)
584 if (getuid() == 0 && !ChangeRoot) {
586 ("ERROR: mkdir security problem - rrdtool is running as "
587 "root but not chroot!\n");
591 if(mkdir(argv[2], 0777)!=0){
592 printf("ERROR: mkdir %s: %s\n", argv[2],rrd_strerror(errno));
597 if (argc > 1 && strcmp("ls", argv[1]) == 0) {
599 printf("ERROR: invalid parameter count for ls\n");
602 if ((curdir = opendir(".")) != NULL) {
603 while ((dent = readdir(curdir)) != NULL) {
604 if (!stat(dent->d_name, &st)) {
605 if (S_ISDIR(st.st_mode)) {
606 printf("d %s\n", dent->d_name);
608 if (strlen(dent->d_name) > 4 && S_ISREG(st.st_mode)) {
610 (dent->d_name + NAMLEN(dent) - 4, ".rrd")
611 || !strcmp(dent->d_name + NAMLEN(dent) - 4,
613 printf("- %s\n", dent->d_name);
620 printf("ERROR: opendir .: %s\n", rrd_strerror(errno));
625 #endif /* opendir and readdir */
629 || strcmp("help", argv[1]) == 0
630 || strcmp("--help", argv[1]) == 0
631 || strcmp("-help", argv[1]) == 0
632 || strcmp("-?", argv[1]) == 0 || strcmp("-h", argv[1]) == 0) {
637 if (strcmp("create", argv[1]) == 0)
638 rrd_create(argc - 1, &argv[1]);
639 else if (strcmp("dump", argv[1]) == 0)
640 rrd_dump(argc - 1, &argv[1]);
641 else if (strcmp("info", argv[1]) == 0 || strcmp("updatev", argv[1]) == 0) {
644 if (strcmp("info", argv[1]) == 0)
646 data = rrd_info(argc - 1, &argv[1]);
648 data = rrd_update_v(argc - 1, &argv[1]);
649 rrd_info_print(data);
653 else if (strcmp("--version", argv[1]) == 0 ||
654 strcmp("version", argv[1]) == 0 ||
655 strcmp("v", argv[1]) == 0 ||
656 strcmp("-v", argv[1]) == 0 || strcmp("-version", argv[1]) == 0)
657 printf("RRDtool " PACKAGE_VERSION
658 " Copyright by Tobi Oetiker, 1997-2008 (%f)\n",
660 else if (strcmp("restore", argv[1]) == 0)
661 rrd_restore(argc - 1, &argv[1]);
662 else if (strcmp("resize", argv[1]) == 0)
663 rrd_resize(argc - 1, &argv[1]);
664 else if (strcmp("last", argv[1]) == 0)
665 printf("%ld\n", rrd_last(argc - 1, &argv[1]));
666 else if (strcmp("lastupdate", argv[1]) == 0) {
667 rrd_lastupdate(argc - 1, &argv[1]);
668 } else if (strcmp("first", argv[1]) == 0)
669 printf("%ld\n", rrd_first(argc - 1, &argv[1]));
670 else if (strcmp("update", argv[1]) == 0)
671 rrd_update(argc - 1, &argv[1]);
672 else if (strcmp("fetch", argv[1]) == 0) {
673 time_t start, end, ti;
674 unsigned long step, ds_cnt, i, ii;
675 rrd_value_t *data, *datai;
679 (argc - 1, &argv[1], &start, &end, &step, &ds_cnt, &ds_namv,
683 for (i = 0; i < ds_cnt; i++)
684 printf("%20s", ds_namv[i]);
686 for (ti = start + step; ti <= end; ti += step) {
687 printf("%10lu:", ti);
688 for (ii = 0; ii < ds_cnt; ii++)
689 printf(" %0.10e", *(datai++));
692 for (i = 0; i < ds_cnt; i++)
697 } else if (strcmp("xport", argv[1]) == 0) {
699 unsigned long int j = 0;
700 time_t start, end, ti;
701 unsigned long step, col_cnt, row_cnt;
702 rrd_value_t *data, *ptr;
706 size_t vtag_s = strlen(COL_DATA_TAG) + 10;
707 char *vtag = malloc(vtag_s);
709 for (i = 2; i < argc; i++) {
710 if (strcmp("--enumds", argv[i]) == 0)
715 (argc - 1, &argv[1], &xxsize, &start, &end, &step, &col_cnt,
716 &legend_v, &data) != -1) {
717 char *old_locale = setlocale(LC_NUMERIC, "C");
718 row_cnt = (end - start) / step;
720 printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n\n",
722 printf("<%s>\n", ROOT_TAG);
723 printf(" <%s>\n", META_TAG);
724 printf(" <%s>%lld</%s>\n", META_START_TAG,
725 (long long int) start + step, META_START_TAG);
726 printf(" <%s>%lu</%s>\n", META_STEP_TAG, step, META_STEP_TAG);
727 printf(" <%s>%lld</%s>\n", META_END_TAG, (long long int) end,
729 printf(" <%s>%lu</%s>\n", META_ROWS_TAG, row_cnt,
731 printf(" <%s>%lu</%s>\n", META_COLS_TAG, col_cnt,
733 printf(" <%s>\n", LEGEND_TAG);
734 for (j = 0; j < col_cnt; j++) {
738 printf(" <%s>%s</%s>\n", LEGEND_ENTRY_TAG, entry,
743 printf(" </%s>\n", LEGEND_TAG);
744 printf(" </%s>\n", META_TAG);
745 printf(" <%s>\n", DATA_TAG);
746 for (ti = start + step; ti <= end; ti += step) {
747 printf(" <%s>", DATA_ROW_TAG);
748 printf("<%s>%lld</%s>", COL_TIME_TAG, (long long int)ti, COL_TIME_TAG);
749 for (j = 0; j < col_cnt; j++) {
750 rrd_value_t newval = DNAN;
754 snprintf(vtag, vtag_s, "%s%lu", COL_DATA_TAG, j);
756 snprintf(vtag, vtag_s, "%s", COL_DATA_TAG);
759 printf("<%s>NaN</%s>", vtag, vtag);
761 printf("<%s>%0.10e</%s>", vtag, newval, vtag);
765 printf("</%s>\n", DATA_ROW_TAG);
768 printf(" </%s>\n", DATA_TAG);
769 printf("</%s>\n", ROOT_TAG);
770 setlocale(LC_NUMERIC, old_locale);
773 } else if (strcmp("graph", argv[1]) == 0) {
776 #ifdef notused /*XXX*/
777 const char *imgfile = argv[2]; /* rrd_graph changes argv pointer */
782 int tostdout = (strcmp(argv[2], "-") == 0);
785 for (i = 2; i < argc; i++) {
786 if (strcmp(argv[i], "--imginfo") == 0
787 || strcmp(argv[i], "-f") == 0) {
793 (argc - 1, &argv[1], &calcpr, &xsize, &ysize, NULL, &ymin,
795 if (!tostdout && !imginfo)
796 printf("%dx%d\n", xsize, ysize);
798 for (i = 0; calcpr[i]; i++) {
800 printf("%s\n", calcpr[i]);
807 } else if (strcmp("graphv", argv[1]) == 0) {
808 rrd_info_t *grinfo = NULL; /* 1 to distinguish it from the NULL that rrd_graph sends in */
810 grinfo = rrd_graph_v(argc - 1, &argv[1]);
812 rrd_info_print(grinfo);
813 rrd_info_free(grinfo);
816 } else if (strcmp("tune", argv[1]) == 0)
817 rrd_tune(argc - 1, &argv[1]);
818 else if (strcmp("flushcached", argv[1]) == 0)
819 rrd_flushcached(argc - 1, &argv[1]);
821 rrd_set_error("unknown function '%s'", argv[1]);
823 if (rrd_test_error()) {
824 fprintf(out, "ERROR: %s\n", rrd_get_error());
838 while (aLine[i] == ' ')
840 while (aLine[i] != 0) {
841 if ((aLine[i] == ' ') && inarg) {
844 if ((aLine[i] != ' ') && !inarg) {
854 * CreateArgs - take a string (aLine) and tokenize
869 /* remove trailing space and newlines */
870 while (len && aLine[len] <= ' ') {
874 /* sikp leading blanks */
875 while (*aLine && *aLine <= ' ')
901 pargv[argc++] = putP;
909 pargv[argc++] = putP;