# Traffic monitoring via VnStat

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="/files/zABvZ1ArqdmrHZGiZ3vL" 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="/files/f1OPnmvD8sdstFro0wbU" 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="/files/TaTbJxq2PRgjefGKthu0" 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://spacecore.gitbook.io/wiki/en/system-monitoring/how-to-see-my-traffic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
