How to get Fortigate interface statistics such as errors/discards

Recently I have needed to get the interface statistics like errors and discards for a Fortigate 5.2. I was using the normal commands that I knew, and some from google such as “diag hardware deviceinfo nic wan1” But had no luck with these commands getting errors/discard count. Maybe this is something they removed.

I started doing some research and found that there was a command that would drop you down to a very limited Linux shell. There are a few commands that are support such as “ifconfig”. This blew me away. I have been wondering if there was a command like this for a long time.

Log in through CLI, and run ” fnsysctl <command>” for example “fnsysctl ls”.

So to get the interface stats, I would just run: “fnsysctl ifconfig port16” or whatever port you want to look at.


And there we go. I have search for some other ways to get this, and have not found anything. If someone finds something better please pass it along.


4 responses to “How to get Fortigate interface statistics such as errors/discards

  1. vigyu October 10, 2014 at 8:06 am


    Thanks for this useful info.
    I tried it on a FortiOS 4 MR3. It works on this version too.

  2. CyberNorris November 22, 2015 at 4:17 pm

    Thanks. Just needed to get error counts to prove a P2P circuit wasn’t passing traffic. This works in 5.2.4 and 5.4 RC1

  3. Freen December 4, 2015 at 1:23 am

    diagnose netlink interface list {interface}, then look for (errors) txe/rxe, (discards) txd/rxd, etc.

  4. JeroGT September 22, 2016 at 1:27 pm

    The command works in this version too!
    Version: FortiWiFi-60D v5.0,build8231,150123 (GA)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: