diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-03-14 09:26:22 +0200 |
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-03-14 10:50:28 +0200 |
| commit | 278912eabf991b593ff67202eb4f5a93b4a0b469 (patch) | |
| tree | 775a8db29ee1b80ba32411ae423b62a6a297bd50 /pimd/pim_cmd.c | |
| parent | 7665a2e1cdb2bfd898921c13226879c69eb2b4fb (diff) | |
pimd: Add additional IGMP stats (generic/group specific queries sent)
```
exit1-debian-11# sh ip igmp statistics
IGMP statistics
Interface : global
V1 query : 0
V2 query : 0
V3 query : 6
V2 leave : 0
V1 report : 0
V2 report : 0
V3 report : 14
mtrace response : 0
mtrace request : 0
unsupported : 0
joins failed : 0
joins sent : 16
general queries sent : 6
group queries sent : 4
total groups : 5
total source groups : 1
exit1-debian-11# sh ip igmp statistics json
{
"global":{
"name":"global",
"queryV1":0,
"queryV2":0,
"queryV3":6,
"leaveV2":0,
"reportV1":0,
"reportV2":0,
"reportV3":18,
"mtraceResponse":0,
"mtraceRequest":0,
"unsupported":0,
"totalGroups":5,
"totalSourceGroups":1,
"joinsFailed":0,
"joinsSent":16,
"generalQueriesSent":6,
"groupQueriesSent":4
}
}
```
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'pimd/pim_cmd.c')
| -rw-r--r-- | pimd/pim_cmd.c | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 1c7fcd62e0..3c2f59bf2f 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -1356,36 +1356,48 @@ static void igmp_show_statistics(struct pim_instance *pim, struct vty *vty, igmp_stats.joins_failed); json_object_int_add(json_row, "joinsSent", igmp_stats.joins_sent); + json_object_int_add(json_row, "generalQueriesSent", + igmp_stats.general_queries_sent); + json_object_int_add(json_row, "groupQueriesSent", + igmp_stats.group_queries_sent); json_object_object_add(json, ifname ? ifname : "global", json_row); vty_json(vty, json); } else { vty_out(vty, "IGMP statistics\n"); - vty_out(vty, "Interface : %s\n", + vty_out(vty, "Interface : %s\n", ifname ? ifname : "global"); - vty_out(vty, "V1 query : %u\n", igmp_stats.query_v1); - vty_out(vty, "V2 query : %u\n", igmp_stats.query_v2); - vty_out(vty, "V3 query : %u\n", igmp_stats.query_v3); - vty_out(vty, "V2 leave : %u\n", igmp_stats.leave_v2); - vty_out(vty, "V1 report : %u\n", + vty_out(vty, "V1 query : %u\n", + igmp_stats.query_v1); + vty_out(vty, "V2 query : %u\n", + igmp_stats.query_v2); + vty_out(vty, "V3 query : %u\n", + igmp_stats.query_v3); + vty_out(vty, "V2 leave : %u\n", + igmp_stats.leave_v2); + vty_out(vty, "V1 report : %u\n", igmp_stats.report_v1); - vty_out(vty, "V2 report : %u\n", + vty_out(vty, "V2 report : %u\n", igmp_stats.report_v2); - vty_out(vty, "V3 report : %u\n", + vty_out(vty, "V3 report : %u\n", igmp_stats.report_v3); - vty_out(vty, "mtrace response : %u\n", + vty_out(vty, "mtrace response : %u\n", igmp_stats.mtrace_rsp); - vty_out(vty, "mtrace request : %u\n", + vty_out(vty, "mtrace request : %u\n", igmp_stats.mtrace_req); - vty_out(vty, "unsupported : %u\n", + vty_out(vty, "unsupported : %u\n", igmp_stats.unsupported); - vty_out(vty, "joins failed : %u\n", + vty_out(vty, "joins failed : %u\n", igmp_stats.joins_failed); - vty_out(vty, "joins sent : %u\n", + vty_out(vty, "joins sent : %u\n", igmp_stats.joins_sent); - vty_out(vty, "total groups : %u\n", + vty_out(vty, "general queries sent : %u\n", + igmp_stats.general_queries_sent); + vty_out(vty, "group queries sent : %u\n", + igmp_stats.group_queries_sent); + vty_out(vty, "total groups : %u\n", igmp_stats.total_groups); - vty_out(vty, "total source groups : %u\n", + vty_out(vty, "total source groups : %u\n", igmp_stats.total_source_groups); } } |
