- char *help_help[2] =
- {
- "Command overview\n"
- ,
- "HELP [<command>]\n"
- "FLUSH <filename>\n"
- "FLUSHALL\n"
- "PENDING <filename>\n"
- "FORGET <filename>\n"
- "UPDATE <filename> <values> [<values> ...]\n"
- "BATCH\n"
- "STATS\n"
- };
-
- char *help_flush[2] =
- {
- "Help for FLUSH\n"
- ,
- "Usage: FLUSH <filename>\n"
- "\n"
- "Adds the given filename to the head of the update queue and returns\n"
- "after is has been dequeued.\n"
- };
-
- char *help_flushall[2] =
- {
- "Help for FLUSHALL\n"
- ,
- "Usage: FLUSHALL\n"
- "\n"
- "Triggers writing of all pending updates. Returns immediately.\n"
- };
-
- char *help_pending[2] =
- {
- "Help for PENDING\n"
- ,
- "Usage: PENDING <filename>\n"
- "\n"
- "Shows any 'pending' updates for a file, in order.\n"
- "The updates shown have not yet been written to the underlying RRD file.\n"
- };
-
- char *help_forget[2] =
- {
- "Help for FORGET\n"
- ,
- "Usage: FORGET <filename>\n"
- "\n"
- "Removes the file completely from the cache.\n"
- "Any pending updates for the file will be lost.\n"
- };
-
- char *help_update[2] =
- {
- "Help for UPDATE\n"
- ,
- "Usage: UPDATE <filename> <values> [<values> ...]\n"
- "\n"
- "Adds the given file to the internal cache if it is not yet known and\n"
- "appends the given value(s) to the entry. See the rrdcached(1) manpage\n"
- "for details.\n"
- "\n"
- "Each <values> has the following form:\n"
- " <values> = <time>:<value>[:<value>[...]]\n"
- "See the rrdupdate(1) manpage for details.\n"
- };
-
- char *help_stats[2] =
- {
- "Help for STATS\n"
- ,
- "Usage: STATS\n"
- "\n"
- "Returns some performance counters, see the rrdcached(1) manpage for\n"
- "a description of the values.\n"
- };
-
- char *help_batch[2] =
- {
- "Help for BATCH\n"
- ,
- "The 'BATCH' command permits the client to initiate a bulk load\n"
- " of commands to rrdcached.\n"
- "\n"
- "Usage:\n"
- "\n"
- " client: BATCH\n"
- " server: 0 Go ahead. End with dot '.' on its own line.\n"
- " client: command #1\n"
- " client: command #2\n"
- " client: ... and so on\n"
- " client: .\n"
- " server: 2 errors\n"
- " server: 7 message for command #7\n"
- " server: 9 message for command #9\n"
- "\n"
- "For more information, consult the rrdcached(1) documentation.\n"
- };
-
- status = buffer_get_field (&buffer, &buffer_size, &command);
- if (status != 0)
- help_text = help_help;
- else
- {
- if (strcasecmp (command, "update") == 0)
- help_text = help_update;
- else if (strcasecmp (command, "flush") == 0)
- help_text = help_flush;
- else if (strcasecmp (command, "flushall") == 0)
- help_text = help_flushall;
- else if (strcasecmp (command, "pending") == 0)
- help_text = help_pending;
- else if (strcasecmp (command, "forget") == 0)
- help_text = help_forget;
- else if (strcasecmp (command, "stats") == 0)
- help_text = help_stats;
- else if (strcasecmp (command, "batch") == 0)
- help_text = help_batch;
- else
- help_text = help_help;
- }