How to monitor network traffic on Ubuntu using vnStat

Monitoring network traffic or bandwitdh usage is a must in a SysAdmin tasks. There are many differents tools to manage this monitoring, but one of my favorites is vnStat. The main advantage of this tool is the simplicity of its usage.

Installation

With Ubuntu, the way to install this tool is with apt.

sudo apt-get install vnstat

First steps

Once installed, it is important to know which interfaces are going to be monitoried. For this, you can use next command

netstat -i

In my case, I have 2 interfaces (eth0, wlan0). The lo interface is the loopback interface, and this is not monitored.

yvoictra|zoar:~$ netstat -i
Kernel Interface table
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 0 0 0 0 0 0 0 BMU
lo 65536 58 0 0 0 58 0 0 0 LRU
wlan0 1500 12521 0 1 0 1962 0 0 0 BMRU
Continue reading How to monitor network traffic on Ubuntu using vnStat

How to Monitor an Ubuntu Server with Grafana & Prometheus

Grafana is an open source metric analytics & visualization tool which can help us to monitor the system with a nice Dashboard.

Step 1: Installing Grafana

Grafana is available in the APT packages repository, however it could not be the latest version, so we’ll use the official Grafana repository.

First, it is needed to create the file /etc/apt/sources.list.d/grafana.list and add the following into it:

deb https://packages.grafana.com/oss/deb stable main

There is a separate repository for beta releases:

deb https://packages.grafana.com/oss/deb beta main

Then it is needed to add the GPG Key, in order to install signed packages:

$ curl https://packages.grafana.com/gpg.key | sudo apt-key add -

Continue reading How to Monitor an Ubuntu Server with Grafana & Prometheus