It seems that when the old code has been migrated to the new https://github.com/vyos/vyos-1x/blob/equuleus/src/op_mode/show_interfaces.py , it doesn't work properly when you clear count for all the interfaces or interface , it keeps showing all data :
vyos@vyos:~$ show interfaces ethernet eth0 eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 50:00:00:03:00:00 brd ff:ff:ff:ff:ff:ff inet 203.0.113.2/30 brd 203.0.113.3 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::5200:ff:fe03:0/64 scope link valid_lft forever preferred_lft forever Last clear: Fri Mar 17 16:19:39 2023 Description: WAN RX: bytes packets errors dropped overrun mcast 2222070 27099 0 0 0 0 TX: bytes packets errors dropped carrier collisions 2225208 27120 0 0 0 0 # clear counters vyos@vyos:~$ clear interfaces counters Clearing eth0 Clearing eth1 Clearing eth2 Clearing eth3 Clearing lo Clearing vtun1 # any clear counter was applied : vyos@vyos:~$ show interfaces ethernet eth0 eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 50:00:00:03:00:00 brd ff:ff:ff:ff:ff:ff inet 203.0.113.2/30 brd 203.0.113.3 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::5200:ff:fe03:0/64 scope link valid_lft forever preferred_lft forever Last clear: Fri Mar 17 16:19:39 2023 Description: WAN RX: bytes packets errors dropped overrun mcast 2223732 27120 0 0 0 0 TX: bytes packets errors dropped carrier collisions 2226972 27142 0 0 0 0
however, when running the following instruction, the excepted results are shown>
vyos@vyos:~$ ${vyatta_bindir}/vyatta-show-interfaces.pl --intf="eth0" eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 50:00:00:03:00:00 brd ff:ff:ff:ff:ff:ff inet 203.0.113.2/30 brd 203.0.113.3 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::5200:ff:fe03:0/64 scope link valid_lft forever preferred_lft forever Last clear: Fri Mar 17 16:19:39 UTC 2023 Description: WAN RX: bytes packets errors dropped overrun mcast 3552 46 0 0 0 0 TX: bytes packets errors dropped carrier collisions 3450 45 0 0 0 0 # new script : vyos@vyos:~$ ${vyos_op_scripts_dir}/show_interfaces.py --intf="eth0" eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 50:00:00:03:00:00 brd ff:ff:ff:ff:ff:ff inet 203.0.113.2/30 brd 203.0.113.3 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::5200:ff:fe03:0/64 scope link valid_lft forever preferred_lft forever Last clear: Fri Mar 17 16:19:39 2023 Description: WAN RX: bytes packets errors dropped overrun mcast 2226012 27150 0 0 0 0 TX: bytes packets errors dropped carrier collisions 2229150 27171 0 0 0 `