Network usage monitor

UUID: netusage@30yavash.com
Last edited:
2 weeks ago 2024-12-01, 09:05
Last commit: [69edcb2a] netusage@30yavash.com: Update German translation (#1364)

Network usage monitor using vnstat

README

Close

Network Usage Desklet

What it does:

This applet keeps track of your Internet usage.

How it does it:

The vnstat daemon runs in the background and collects info about your Internet usage all the time the machine is running and maintains a data set from once it is initially activated.

The applet detects which device you're currently using, and simply exports a graph using vnstati. The latest version allows you to select the type of graph although for most users the default summary will be the most useful.

You can have multiple instances to display several graphs in parallel.

There is a similar applet, vnstat@linuxmint.com , which can also be run in parallel.

What you need for it to work:

You need:

  • To install vnstat
  • To install vnstati
  • To have the vnstat daemon running
  • To have vnstat configured for the devices you are using.

Notes: In Linux Mint, you can simply run apt install vnstati and that will take care of everything for the built in devices. In other distributions it might depend on the way things are packaged but it's likely to be similar.

It is possible to add additional devices, for example a USB Mobile Internet stick. Running man vnstat will give some information on how to proceed but beware it is not trivial.

Use on Distributions other than Mint:

  • The original versions assumed the NMClient and NetworkManager libraries are in use as is the case in Mint versions up to 18.3 and most other current distro versions.
  • Version 1.0.0 can also switch to the more recent NM library used on some recent distributions such as Fedora 27 and higher.
    • Version 1.0.1 and higher can only use the new NM libraries when Cinnamon 4.0 or higher is in use to avoid potential segfaults in Cinnamon 4.0. This should support all current Linux Distributions which support Cinnamon 4.0.
  • It is possible that you may have to set up vnstati on other distributions - running man vnstat will provide information on how to proceed if that is the case.
  • Feedback on your experiences on other distributions would be welcome.

Contributors

  • The Desklet is based on an Applet by Clem.
  • The original Author of the Desklet was Siavash Salemi - 28 Sep 2013
  • Translation Support and bug fixes by NikoKrause
  • Network manager selection by Peter Curtis based on a technique by Jason Hicks

Support

*It is now being supported and extended by @pdcurtis who is now listed as the current author. He occasionally checks the comments on the Cinnamon Spices Web Site, however that does not automatically notify him so if you want a rapid response please also alert him via the Form at www.pcurtis.com. On github, mentioning @pdcurtis in any conversation will cause it to be emailed to him.

CHANGELOG

Open

Log In To Comment!

19 Comments

Nelson Teixeira
Nelson Teixeira-2 months ago
Very interesting desklet thanks. I just wanted a dark mode option. so I tried to include the line "Custom Classic - Summary of Traffic for last Days and Months" : "-s -ic -nh", in settings-schema.json but it didn't work. The option apeard but when I selected it it just throw an error at me. The most strange thing is that I tried to debug it in _showMesssage method and no matter what I did the original message kept apearing. Even when I commented all lines in _showMessage. This is probably by some desklet environment caracteristic I'm not aware or have time to fix. Could you just include this option. ? You just have to add -ic -nh to vnstati command line.
Umit Sayman
Umit Sayman-3 years ago
Hello everyone, I guess this applet gives the statistics according to your surf time spent in Linux OS. As I am running Linux parallel with Windows, it will not show the data used when in Windows 10. So my question is; is there a way for this desklet to communicate with our modem and get the Rx and Tx from the modem/router etc???
Ray-G-M
Ray-G-M-3 years ago
Agree. In my case it would be useful to see the modem's total demand and usage for all connected devices. I can log into the modem via its browser interface, but that is far from being as useful as this one's notification bar. But I suspect such a thing may be beyond the intent of this desklet.
Mike
Mike-3 years ago
Hey there, I love this desklet. I configured my vnstat config my ethernet as default. Though while adding the desklet it chooses my docker or another interface. How to configure this? Someone any idea? What other information you need from me? Grtz Mike Mulders
JanuszSpiewa
JanuszSpiewa-4 years ago
don't work in cinnamon to linux mint 18.3
OldScho0l
OldScho0l-5 years ago
Sorry i am bad at linux but where do this file install ? I wanna change the text colors and the background to dark as i use dark themes and this is just way too bright as the only thing. Can you please link the path to the file and the file name ?
jakub-sika
jakub-sika-5 years ago
Hi, it seems not to work with my Linux Mint 19.2!
OldScho0l
OldScho0l-5 years ago
did u install vnstat & vnstati ?
Davide Zipeto
Davide Zipeto-5 years ago
Hello, the desklet worked great in mint 19 until last month. Now it seems when on start there's an error happening. Is there [how to find them?] any debug log that I can submit?
Peter Curtis
Peter Curtis-6 years ago
I have tested it and it is in full time use under Mint 19.
Umit Sayman
Umit Sayman-3 years ago
Hi Pete, I guess this applet gives the statistics according to your surf time spent in Linux OS. As I am running Linux parallel with Windows, it will not show the data used when in Windows 10. So my question is; is there a way for this desklet to communicate with our modem and get the Rx and Tx from the modem/router etc???
hefti33
hefti33-6 years ago
I have a 4K display and therefore the data's are not readable (all figures are much to small). Is there any possibility to adapt the font size?
Peter Curtis
Peter Curtis-6 years ago
The Desklet works by displaying the output of the utility vnstati which creates an image. vnstati currently has no options to change font or image size that I can find. It might be possible to scale the whole image each time before it is displayed using a command line utility such as imagemagick. One would need to think about the overheads and timing, and preferably make the system calls asyncronous. I can give some hints if you want to try it out.
tikondrus
tikondrus-6 years ago
Does not work on Fedora 27. Cinnamon crashed.
Peter Curtis
Peter Curtis-6 years ago
This was the result of an update to the Network Manager in Fedora 27. The original version assumed the NMClient and NetworkManager libraries were in use as is the case in Mint versions up to 18.3 and most other current distro versions. I have added code to the latest version of this Desklet so it can switch to the more recent NM library used on some recent distributions such as Fedora 27. I have tested on a Fedora 27 LiveUSB but confirmation from a user of Fedora that the Desklet is fixed would be helpful
Fedora Tux
Fedora Tux-7 years ago
Not working in Fedora 26, also it would be nice to insert a transparency in the box!!!
Paul Miller
Paul Miller-7 years ago
I'm using fedora 26 myself and it seems to be working fine. Once you have vnstat and run it as a daemon. It took a while to start populating but you expect that given it is based on historical data.
Peter Curtis
Peter Curtis-7 years ago
Roy, Yes it is possible to set up to add additional network data monitoring in vnstat - I have done so on my applet, the Network Usage Monitor with Alerts which also has an option of displaying vnstati output and I put a little bit of information in the associated help file. In summary The system program vnstat is automatically set up when it is installed to monitor the network devices/interfaces installed in the machine at the time and it then keeps a log of hourly, daily and monthly network traffic by use of a daemon. It is definitely possible to add additional USB network devices and possibly bluetooth devices to the list of monitored interfaces at a latter stage and I have done so for USB devices. man vnstat in a terminal will give details but be warned, it is not trivial to do!
Roy Gilby
Roy Gilby-7 years ago
Many thanks. Your desklet works great. Are there any configuration files behind the scenes that would allow me to add additional network usage data to the desklet ?