Page MenuHomeVyOS Platform

the operational command "show interfaces ethernet ethx" doesn't reflect a call to 'clear counters'
In progress, NormalPublicBUG

Description

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 :

[email protected]:~$ 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 
[email protected]:~$ clear interfaces counters
Clearing eth0
Clearing eth1
Clearing eth2
Clearing eth3
Clearing lo
Clearing vtun1

# any clear counter was applied : 

[email protected]:~$ 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>

[email protected]:~$ ${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 : 

[email protected]:~$  ${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

`

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.3.2
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

jestabro changed Difficulty level from Hard (possibly days) to Normal (likely a few hours).Wed, Mar 22, 9:16 PM
jestabro renamed this task from the operational command "show interfaces ethernet ethx" doesn't show when clears counts to the operational command "show interfaces ethernet ethx" doesn't reflect a call to 'clear counters'.Fri, Mar 24, 12:37 AM
jestabro changed the task status from Open to In progress.
jestabro triaged this task as Normal priority.