Technical Note: How to clear policy counters from CLI
Description
This document provides a procedure from CLI to clear policy counters. Some FortiGate models do not support clear action from GUI.
Scope
All FortiGate units, Firmware 5.0 and above.
Solution
- Connect to FortiGate through SSh or Serial Console and type the follow commands:
You can clear more than 1 counter just adding policies ID. That is:
idx=48 pkts/bytes=0/0
idx=4 pkts/bytes=0/0
Counters from Policies ID 3, 12, 48 and 4 has been cleared.
This document provides a procedure from CLI to clear policy counters. Some FortiGate models do not support clear action from GUI.
Scope
All FortiGate units, Firmware 5.0 and above.
Solution
- Connect to FortiGate through SSh or Serial Console and type the follow commands:
# diagnose firewall iprope clear 00100004 3
idx=3 pkts/bytes=0/0
The "groupid" is 00100004, this value is for configurable firewall policies.
The "idx" is the index number of the firewall policy as found in ID column from Policy GUI sectionYou can clear more than 1 counter just adding policies ID. That is:
# diagnose firewall iprope clear 00100004 3 12 48 4
idx=3 pkts/bytes=0/0
idx=12 pkts/bytes=0/0idx=48 pkts/bytes=0/0
idx=4 pkts/bytes=0/0
Counters from Policies ID 3, 12, 48 and 4 has been cleared.
