I think since the HTTP endpoint is called /metrics bgpctl should also use
metrics and not metric. Also add a bit of documentation to the man pages.
--
:wq Claudio
Index: bgpctl/bgpctl.8
===================================================================
RCS file: /cvs/src/usr.sbin/bgpctl/bgpctl.8,v
retrieving revision 1.101
diff -u -p -r1.101 bgpctl.8
--- bgpctl/bgpctl.8 1 Sep 2022 22:24:40 -0000 1.101
+++ bgpctl/bgpctl.8 17 Oct 2022 13:28:49 -0000
@@ -211,6 +211,8 @@ instead of the default routing table wit
.El
.It Cm show interfaces
Show the interface states.
+.It Cm show metrics
+Dump various BGP statistics in OpenMetrics format.
.It Xo
.Cm show mrt
.Op Ar options
Index: bgpctl/parser.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpctl/parser.c,v
retrieving revision 1.115
diff -u -p -r1.115 parser.c
--- bgpctl/parser.c 17 Oct 2022 12:01:19 -0000 1.115
+++ bgpctl/parser.c 17 Oct 2022 13:27:07 -0000
@@ -141,7 +141,7 @@ static const struct token t_show[] = {
{ KEYWORD, "sets", SHOW_SET, NULL},
{ KEYWORD, "rtr", SHOW_RTR, NULL},
{ KEYWORD, "mrt", SHOW_MRT, t_show_mrt},
- { KEYWORD, "metric", SHOW_METRIC, NULL},
+ { KEYWORD, "metrics", SHOW_METRIC, NULL},
{ ENDTOKEN, "", NONE, NULL}
};
Index: bgplgd/bgplgd.8
===================================================================
RCS file: /cvs/src/usr.sbin/bgplgd/bgplgd.8,v
retrieving revision 1.3
diff -u -p -r1.3 bgplgd.8
--- bgplgd/bgplgd.8 17 Jul 2022 10:32:45 -0000 1.3
+++ bgplgd/bgplgd.8 17 Oct 2022 13:30:03 -0000
@@ -90,6 +90,8 @@ Unless further specified the endpoints d
Show the interface states.
.It Pa /memory
Show RIB memory statistics.
+.It Pa /metrics
+Output various statistics in OpenMetrics format.
.It Pa /neighbors
Show detailed neighbors information.
The output can be limited with the following parameters:
Index: bgplgd/bgplgd.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgplgd/bgplgd.c,v
retrieving revision 1.2
diff -u -p -r1.2 bgplgd.c
--- bgplgd/bgplgd.c 17 Oct 2022 13:23:31 -0000 1.2
+++ bgplgd/bgplgd.c 17 Oct 2022 13:30:36 -0000
@@ -44,7 +44,7 @@ const struct cmd {
{ "/rtr", { "show", "rtr", NULL }, 0 },
{ "/sets", { "show", "sets", NULL }, 0 },
{ "/summary", { "show", NULL }, 0 },
- { "/metrics", { "show", "metric", NULL }, 0, 0, OMETRIC_TYPE },
+ { "/metrics", { "show", "metrics", NULL }, 0, 0, OMETRIC_TYPE },
{ NULL }
};