Clear statistics HP ProCurve switch without reboot

It is useful to be able to clear all counters and statistics from a HP ProCurve switch without rebooting the switch when troubleshooting network issues. The clear statistics global command clears all counters and statistics for all interfaces except SNMP.

You can also clear the counters and statistics for an individual port using the clear statistics <port-list> command.

clear statistics <<port-list> | global >

When executed with the <port-list> option, clears the counters and statistics for an individual port.When executed with the global option, clears all counters and statistics for all interfaces except SNMP. The show interfaces [<port-list>] command displays the totals accumulated since the last boot or the last clear statistics command was executed. The menu and web pages also display these totals.

SNMP displays the counter and statistics totals accumulated since the last reboot; it is not affected by the clear statistics global command or the clear statistics <port-list> command. An SNMP trap is sent whenever the statistics are cleared.

Note
The clearing of statistics cannot be uncleared.

Posted in Switches and tagged , , , .

5 Comments

  1. Great tip. Only issue I have, is that the stat-reset isn’t reflected in the web interface on the switch.
    Is there any way to clear the stats there too?

  2. The clear statistics command only doesn’t truly clear the statistics of the port. It only clears the statistics from being displayed during the current session. Once you log out and back in, the statistics since reboot are still there. So a reboot is still required for a true clearing of port statistics.

  3. Thank you for the writeup. One quick note: on an HP ProCurve 2848 (firmware version 1.08.58), the correct command is:
    clear statistics all
    rather than
    clear statistics global
    If you use the “global” flag, the command results in an “invalid input” error.

    Also, on the ProCurve 2848, I can confirm the CLI does NOT reset the web view of the port statistics, even after refreshing or logging out of the web page (with subsequent logging back in).

Leave a Reply