> For the complete documentation index, see [llms.txt](https://spacecore.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spacecore.gitbook.io/wiki/en/system-monitoring/how-to-see-my-traffic.md).

# Traffic monitoring via VnStat

{% hint style="danger" %}

### This content is outdated

**The knowledge base has moved →** [**https://wiki.spacecore.pro/**](https://wiki.spacecore.pro/)

This wiki is no longer updated. All current guides and articles are at the new address.
{% endhint %}

{% content-ref url="<https://wiki.spacecore.pro/>" %}
<https://wiki.spacecore.pro/>
{% endcontent-ref %}

***

This is a simple utility that allows you to see the load statistics of network interfaces.

You can install **VnStat** with the following commands:

**Debian/Ubuntu**

**CentOS**

```
yum install vnstat
```

Done. Moving on. We can configure the information in the utility’s CLI interface by configuring along the way `/etc/vnstat.conf`.

For example, you can specify a network interface to be listened on by default.

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FLRVBl0z6QbnKgMXUHuIt%2Fimage.png?alt=media&amp;token=657ab13e-2061-487c-8f29-0da8612fdd25" alt=""><figcaption></figcaption></figure>

**VnStat** saves interface statistics databases in`/var/lib/vnstat`.

With the `vnstat -i eth0` command we can see the total statistics (if it has accumulated) on the load of a particular interface or all, unless you specify the parameter.

{% hint style="warning" %}
Replace **eth0** with the required network interface.
{% endhint %}

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2F5dHk1ExN0iQwc6dc2zIB%2Fimage.png?alt=media&amp;token=30c188a4-0ae4-47c8-8378-5ea58336d8d5" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Available arguments:

* **-l** — real-time traffic collection.
* **-s** — summary.
* **-t** — withdrawal of the ten days in which the load was highest.
* **-h** — information for the last hour.
* **-d** — for the last day.
* **-w** — in the last week.
* **-m** — in the last month.
  {% endhint %}

For example, if you want to check the current load of your server’s network channel, this command will work. Remember to specify a correct network interface.

```
vnstat -l -i eth0
```

<figure><img src="https://287241268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyXvdNIxNLIOcexv7AfU2%2Fuploads%2FzYZh6hpVfmTX3o0z5Xuh%2Fimage.png?alt=media&amp;token=698f5124-c900-437d-bd81-7e8881a98874" alt=""><figcaption></figcaption></figure>

Such output allows to determine whether the server is under **DDoS-attack**. High incoming traffic and a large number of incoming packets do not guarantee that this is the type of attack, but you should definitely pay attention to the protection services from DDoS.
