Generate a stats-file which can be used to preload haproxy counters values on
startup. See "Stats-file" section for more detail.
+echo <text>
+ Print some text with the CLI. Can be useful to wrote commentaries between
+ commands when dumping the result of multiple commands.
+
+ Example:
+
+ echo "expert-mode on; echo FDs from fdtab; show fd; echo wild FDs; debug dev fd" | socat /var/run/haproxy.sock -
+
+
enable agent <backend>/<server>
Resume auxiliary agent check that was temporarily stopped.
return 1;
}
+static int cli_parse_echo(char **args, char *payload, struct appctx *appctx, void *private)
+{
+ int i = 1; /* starts after 'echo' */
+
+ chunk_reset(&trash);
+
+ while (*args[i]) {
+ /* add a space if there was a word before */
+ if (i == 1)
+ chunk_printf(&trash, "%s", args[i]);
+ else
+ chunk_appendf(&trash, " %s", args[i]);
+ i++;
+ }
+ chunk_appendf(&trash, "\n");
+
+ cli_msg(appctx, LOG_INFO, trash.area);
+
+ return 1;
+}
+
static int _send_status(char **args, char *payload, struct appctx *appctx, void *private)
{
struct listener *mproxy_li;
/* register cli keywords */
static struct cli_kw_list cli_kws = {{ },{
{ { "help", NULL }, NULL, cli_parse_simple, NULL, NULL, NULL, ACCESS_MASTER },
+ { { "echo", NULL }, "echo <text> : print text to the output", cli_parse_echo, NULL, NULL, NULL, ACCESS_MASTER },
{ { "prompt", NULL }, NULL, cli_parse_simple, NULL, NULL, NULL, ACCESS_MASTER },
{ { "quit", NULL }, NULL, cli_parse_simple, NULL, NULL, NULL, ACCESS_MASTER },
{ { "_getsocks", NULL }, NULL, _getsocks, NULL },