Display data traffic statistics and estimates from vnStat for today and the current month on your Ubuntu Server login motd aka ‘message of the day.’

  1. 1. Install vnStat
  2. 2. Add the script 60-vnstat to the motd
  3. 3. Logoff and login again :)
  4. Downloads
  5. Related stuff

1. Install vnStat

sudo apt-get install vnstat

sudo vnstat -i eth0 -u --enable

2. Add the script 60-vnstat to the motd

The number decides the position on the motd message. For example, 50 is the system info like system load and memory usage, and 90 is the update checker.

First write the script:

sudo nano /etc/update-motd.d/60-vnstat

Then make it executable:

sudo chmod 755 /etc/update-motd.d/60-vnstat

3. Logoff and login again :)

 

Downloads

60-vnstat.txt

Rename to `60-vnstat` after download


PLAIN (156 B) ▼ Download