From b314f3649c56773826439e88a60c61916067e448 Mon Sep 17 00:00:00 2001 From: jcaiMR Date: Sun, 10 Sep 2023 12:25:32 +0000 Subject: [PATCH] add show dhcp_relay ipv4 counter entry, fix interface name offset issue --- .../docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py b/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py index 0d360aef9be..578f687f9c2 100644 --- a/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py +++ b/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py @@ -56,7 +56,7 @@ def get_interface(self): interfaces = [] for key in self.db.keys(self.db.STATE_DB): if DHCPv4_COUNTER_TABLE in key: - interfaces.append(key[21:]) + interfaces.append(key[19:]) return interfaces def get_dhcp4relay_msg_count(self, interface, dir): @@ -274,6 +274,10 @@ def dhcp_relay_ipv4_destination(): def dhcp_relay_ipv6_destination(): get_dhcp_relay(DHCP_RELAY, DHCPV6_SERVERS, with_header=True) +@dhcp_relay_ipv4.command("counters") +@click.option('-i', '--interface', required=False) +def dhcp_relay_ip4counters(interface): + ipv4_counters(interface) @dhcp_relay_ipv6.command("counters") @click.option('-i', '--interface', required=False)